msm8974-common: gps: Delete libloc_api-rpc
* This isn't needed Change-Id: I7b4b33256fac5ae71b2e556ed04f0069d1aa9f39
This commit is contained in:
parent
29b6ae6ad8
commit
9cf367bddf
32 changed files with 0 additions and 9893 deletions
|
@ -2,13 +2,6 @@ ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),)
|
||||||
|
|
||||||
LOCAL_PATH := $(call my-dir)
|
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/
|
GPS_DIR_LIST += $(LOCAL_PATH)/libloc_api_50001/
|
||||||
|
|
||||||
#call the subfolders
|
#call the subfolders
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
ifeq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_AMSS_VERSION),50001)
|
|
||||||
include $(call all-subdir-makefiles)
|
|
||||||
endif
|
|
|
@ -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)
|
|
|
@ -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
|
|
|
@ -1,140 +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 <rpc/rpc.h>
|
|
||||||
#include <loc_api_rpcgen_common_rpc.h>
|
|
||||||
#include <loc_api_rpc_glue.h>
|
|
||||||
#include <LocApiBase.h>
|
|
||||||
#include <loc_log.h>
|
|
||||||
|
|
||||||
using namespace loc_core;
|
|
||||||
|
|
||||||
class LocApiRpc : public LocApiBase {
|
|
||||||
protected:
|
|
||||||
// RPC communication establishment
|
|
||||||
rpc_loc_client_handle_type client_handle;
|
|
||||||
|
|
||||||
private:
|
|
||||||
int dataEnableLastSet;
|
|
||||||
char apnLastSet[MAX_APN_LEN];
|
|
||||||
|
|
||||||
static const LOC_API_ADAPTER_EVENT_MASK_T maskAll;
|
|
||||||
static const rpc_loc_event_mask_type locBits[];
|
|
||||||
static rpc_loc_event_mask_type convertMask(LOC_API_ADAPTER_EVENT_MASK_T mask);
|
|
||||||
static rpc_loc_lock_e_type convertGpsLockMask(LOC_GPS_LOCK_MASK lockMask);
|
|
||||||
static enum loc_api_adapter_err convertErr(int rpcErr);
|
|
||||||
static GpsNiEncodingType convertNiEncodingType(int loc_encoding);
|
|
||||||
static int NIEventFillVerfiyType(GpsNiNotification ¬if,
|
|
||||||
rpc_loc_ni_notify_verify_e_type notif_priv);
|
|
||||||
|
|
||||||
void reportPosition(const rpc_loc_parsed_position_s_type *location_report_ptr);
|
|
||||||
void reportSv(const rpc_loc_gnss_info_s_type *gnss_report_ptr);
|
|
||||||
void reportStatus(const rpc_loc_status_event_s_type *status_report_ptr);
|
|
||||||
void reportNmea(const rpc_loc_nmea_report_s_type *nmea_report_ptr);
|
|
||||||
void ATLEvent(const rpc_loc_server_request_s_type *server_request_ptr);
|
|
||||||
void NIEvent(const rpc_loc_ni_event_s_type *ni_req_ptr);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
virtual enum loc_api_adapter_err
|
|
||||||
open(LOC_API_ADAPTER_EVENT_MASK_T mask);
|
|
||||||
virtual enum loc_api_adapter_err
|
|
||||||
close();
|
|
||||||
|
|
||||||
public:
|
|
||||||
LocApiRpc(const MsgTask* msgTask,
|
|
||||||
LOC_API_ADAPTER_EVENT_MASK_T exMask);
|
|
||||||
~LocApiRpc();
|
|
||||||
|
|
||||||
virtual int locEventCB(rpc_loc_client_handle_type client_handle,
|
|
||||||
rpc_loc_event_mask_type loc_event,
|
|
||||||
const rpc_loc_event_payload_u_type* loc_event_payload);
|
|
||||||
|
|
||||||
void locRpcGlobalCB(CLIENT* clnt, enum rpc_reset_event event);
|
|
||||||
|
|
||||||
// RPC adapter interface implementations
|
|
||||||
virtual enum loc_api_adapter_err
|
|
||||||
startFix(const LocPosMode& posMode);
|
|
||||||
virtual enum loc_api_adapter_err
|
|
||||||
stopFix();
|
|
||||||
virtual enum loc_api_adapter_err
|
|
||||||
setPositionMode(const LocPosMode& mode);
|
|
||||||
inline virtual enum loc_api_adapter_err
|
|
||||||
enableData(int enable) { return enableData(enable, false); }
|
|
||||||
virtual enum loc_api_adapter_err
|
|
||||||
enableData(int enable, boolean force);
|
|
||||||
virtual enum loc_api_adapter_err
|
|
||||||
setTime(GpsUtcTime time, int64_t timeReference, int uncertainty);
|
|
||||||
virtual enum loc_api_adapter_err
|
|
||||||
injectPosition(double latitude, double longitude, float accuracy);
|
|
||||||
virtual enum loc_api_adapter_err
|
|
||||||
deleteAidingData(GpsAidingData f);
|
|
||||||
virtual enum loc_api_adapter_err
|
|
||||||
informNiResponse(GpsUserResponseType userResponse, const void* passThroughData);
|
|
||||||
inline virtual enum loc_api_adapter_err
|
|
||||||
setAPN(char* apn, int len) { return setAPN(apn, len, false); }
|
|
||||||
virtual enum loc_api_adapter_err
|
|
||||||
setAPN(char* apn, int len, boolean force);
|
|
||||||
virtual enum loc_api_adapter_err
|
|
||||||
setServer(const char* url, int len);
|
|
||||||
virtual enum loc_api_adapter_err
|
|
||||||
setServer(unsigned int ip, int port, LocServerType type);
|
|
||||||
virtual enum loc_api_adapter_err
|
|
||||||
setXtraData(char* data, int length);
|
|
||||||
virtual enum loc_api_adapter_err
|
|
||||||
requestXtraServer();
|
|
||||||
virtual enum loc_api_adapter_err
|
|
||||||
atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bear, AGpsType agpsType);
|
|
||||||
virtual enum loc_api_adapter_err
|
|
||||||
atlCloseStatus(int handle, int is_succ);
|
|
||||||
virtual enum loc_api_adapter_err
|
|
||||||
setSUPLVersion(uint32_t version);
|
|
||||||
virtual void setInSession(bool inSession);
|
|
||||||
|
|
||||||
/*Values for lock
|
|
||||||
1 = Do not lock any position sessions
|
|
||||||
2 = Lock MI position sessions
|
|
||||||
3 = Lock MT position sessions
|
|
||||||
4 = Lock all position sessions
|
|
||||||
*/
|
|
||||||
virtual int setGpsLock(LOC_GPS_LOCK_MASK lock);
|
|
||||||
/*
|
|
||||||
Returns
|
|
||||||
Current value of GPS Lock on success
|
|
||||||
-1 on failure
|
|
||||||
*/
|
|
||||||
virtual int getGpsLock(void);
|
|
||||||
};
|
|
||||||
|
|
||||||
extern "C" LocApiBase* getLocApi(const MsgTask* msgTask,
|
|
||||||
LOC_API_ADAPTER_EVENT_MASK_T exMask,
|
|
||||||
ContextBase *context);
|
|
||||||
|
|
||||||
#endif //LOC_API_RPC_H
|
|
|
@ -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 <stdio.h>
|
|
||||||
|
|
||||||
#define LOG_TAG "LocSvc_rpc"
|
|
||||||
#include <utils/Log.h>
|
|
||||||
|
|
||||||
#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*/
|
|
|
@ -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 */
|
|
|
@ -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 <ctype.h>
|
|
||||||
#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 */
|
|
|
@ -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 <rpc/clnt.h>
|
|
||||||
|
|
||||||
#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 */
|
|
|
@ -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 */
|
|
|
@ -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 */
|
|
File diff suppressed because it is too large
Load diff
|
@ -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 <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 */
|
|
|
@ -1,345 +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.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#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 "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);
|
|
||||||
}
|
|
|
@ -1,636 +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 FILES FOR MODULE
|
|
||||||
|
|
||||||
======================================================================*/
|
|
||||||
#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 <loc_api_log.h>
|
|
||||||
|
|
||||||
#include <rpc/rpc.h>
|
|
||||||
|
|
||||||
/* 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 <utils/Log.h>
|
|
||||||
#endif /* USE_GLIB */
|
|
||||||
|
|
||||||
/* Logging Improvement */
|
|
||||||
#include "log_util.h"
|
|
||||||
#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_<version>_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_<version>_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_<version>_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;
|
|
||||||
}
|
|
|
@ -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 <stdio.h>
|
|
||||||
#include <assert.h>
|
|
||||||
#include <errno.h>
|
|
||||||
#include <sys/time.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <pthread.h>
|
|
||||||
|
|
||||||
#include <rpc/rpc.h>
|
|
||||||
#include <loc_api_rpc_glue.h>
|
|
||||||
#include "loc_api_sync_call.h"
|
|
||||||
|
|
||||||
/* Logging */
|
|
||||||
#define LOG_TAG "LocSvc_api_rpc_glue"
|
|
||||||
// #define LOG_NDDEBUG 0
|
|
||||||
#ifndef USE_GLIB
|
|
||||||
#include <utils/Log.h>
|
|
||||||
#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;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -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;
|
|
||||||
}
|
|
||||||
|
|
|
@ -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)
|
|
|
@ -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
|
|
|
@ -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 <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 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 */
|
|
File diff suppressed because it is too large
Load diff
|
@ -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 <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 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 */
|
|
|
@ -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();
|
|
||||||
|
|
|
@ -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 <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_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;
|
|
||||||
}
|
|
|
@ -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;
|
|
||||||
}
|
|
|
@ -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 <memory.h> /* 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));
|
|
||||||
}
|
|
File diff suppressed because it is too large
Load diff
|
@ -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;
|
|
||||||
}
|
|
|
@ -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);
|
|
||||||
}
|
|
|
@ -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;
|
|
|
@ -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;
|
|
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue