librpc: XDRs and glue code for AMSS 1240

Change-Id: Ic69d0085ab8793c6d32f811892cb3e0375b2ef6c
Signed-off-by: Mike Lockwood <lockwood@android.com>
This commit is contained in:
Mike Lockwood 2010-06-17 10:58:49 -07:00
parent fba22d5c62
commit c6419effb6
18 changed files with 5295 additions and 11 deletions

View file

@ -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/a#include \"loc_api_fixup.h\"" > ../$(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)))

View file

@ -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;

View file

@ -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;

View file

@ -0,0 +1,64 @@
/*
* Please do not edit this file.
* It was generated using rpcgen.
*/
#include "loc_api_cb.h"
#include <stdio.h>
#include <stdlib.h>
#include <rpc/pmap_clnt.h>
#include <string.h>
#include <memory.h>
#include <sys/socket.h>
#include <netinet/in.h>
#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;
}

View file

@ -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;
}

View file

@ -0,0 +1,91 @@
/*
* Please do not edit this file.
* It was generated using rpcgen.
*/
#include <memory.h> /* 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));
}

View file

@ -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;
};

File diff suppressed because it is too large Load diff

View file

@ -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 <rpc/rpc.h>
#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 */

View file

@ -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 <stdio.h>
#include <pthread.h>
#include <errno.h>
#include <string.h>
#include <sys/select.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <unistd.h>
#include <stdlib.h>
#include <assert.h>
#include <rpc/rpc.h>
#include <rpc/clnt.h>
/* 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 <utils/Log.h>
/* 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;
}

View file

@ -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;
}

View file

@ -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 <rpc/rpc.h>
#include <pthread.h>
#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 */

View file

@ -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 <rpc/rpc.h>
#include <pthread.h>
#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 */

File diff suppressed because it is too large Load diff

View file

@ -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 */

View file

@ -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 */

View file

@ -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);

View file

@ -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);