Merge "Move loc_api_v02 to vendor/qcom-opensource/location"
This commit is contained in:
commit
013dbdc8c0
13 changed files with 1 additions and 19297 deletions
|
@ -4,7 +4,7 @@ LOCAL_PATH := $(call my-dir)
|
|||
|
||||
GPS_DIR_LIST :=
|
||||
|
||||
FEATURE_DELEXT := true
|
||||
FEATURE_DELEXT := false
|
||||
|
||||
# add RPC dirs if RPC is available
|
||||
ifneq ($(TARGET_NO_RPC),true)
|
||||
|
@ -23,9 +23,6 @@ QMI_BOARD_PLATFORM_LIST += msm8226
|
|||
QMI_BOARD_PLATFORM_LIST += msm8610
|
||||
endif
|
||||
|
||||
ifeq ($(call is-board-platform-in-list,$(QMI_BOARD_PLATFORM_LIST)),true)
|
||||
GPS_DIR_LIST += $(LOCAL_PATH)/loc_api_v02/
|
||||
endif #is-board-platform-in-list
|
||||
|
||||
GPS_DIR_LIST += $(LOCAL_PATH)/libloc_api_50001/
|
||||
|
||||
|
|
|
@ -1,46 +0,0 @@
|
|||
ifneq ($(BUILD_TINY_ANDROID),true)
|
||||
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := libloc_api_v02
|
||||
|
||||
LOCAL_MODULE_TAGS := optional
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := \
|
||||
libutils \
|
||||
libcutils \
|
||||
libqmi_cci \
|
||||
libqmi_csi \
|
||||
libqmi_common_so \
|
||||
libloc_adapter \
|
||||
libgps.utils
|
||||
|
||||
LOCAL_SRC_FILES += \
|
||||
LocApiV02Adapter.cpp \
|
||||
loc_api_v02_log.c \
|
||||
loc_api_v02_client.c \
|
||||
loc_api_sync_req.c \
|
||||
location_service_v02.c
|
||||
|
||||
LOCAL_CFLAGS += \
|
||||
-fno-short-enums \
|
||||
-D_ANDROID_
|
||||
|
||||
ifeq ($(FEATURE_DELEXT), true)
|
||||
LOCAL_CFLAGS += -DFEATURE_DELEXT
|
||||
endif #FEATURE_DELEXT
|
||||
|
||||
## Includes
|
||||
LOCAL_C_INCLUDES := \
|
||||
$(TARGET_OUT_HEADERS)/libloc_eng \
|
||||
$(TARGET_OUT_HEADERS)/qmi-framework/inc \
|
||||
$(TARGET_OUT_HEADERS)/qmi/inc \
|
||||
$(TARGET_OUT_HEADERS)/gps.utils
|
||||
|
||||
LOCAL_PRELINK_MODULE := false
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
endif # not BUILD_TINY_ANDROID
|
File diff suppressed because it is too large
Load diff
|
@ -1,169 +0,0 @@
|
|||
/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation, nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef LOC_API_V_0_2_ADAPTER_H
|
||||
#define LOC_API_V_0_2_ADAPTER_H
|
||||
|
||||
#include <LocApiAdapter.h>
|
||||
#include "loc_api_v02_client.h"
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
/* This class derives from the LocApiAdapter class.
|
||||
The members of this class are responsible for converting
|
||||
the Loc API V02 data structures into Loc Engine data structures.
|
||||
This class also implements some of the virtual functions that
|
||||
handle the requests from loc engine. */
|
||||
class LocApiV02Adapter : public LocApiAdapter {
|
||||
|
||||
/* loc api v02 handle*/
|
||||
locClientHandleType clientHandle;
|
||||
|
||||
/* events the client is registered for */
|
||||
locClientEventMaskType eventMask;
|
||||
|
||||
/* Convert event mask from loc eng to loc_api_v02 format */
|
||||
locClientEventMaskType convertMask(LOC_API_ADAPTER_EVENT_MASK_T mask);
|
||||
|
||||
/* Convert error from loc_api_v02 to loc eng format*/
|
||||
enum loc_api_adapter_err convertErr(locClientStatusEnumType status);
|
||||
|
||||
/* convert Ni Encoding type from QMI_LOC to loc eng format */
|
||||
GpsNiEncodingType convertNiEncoding(
|
||||
qmiLocNiDataCodingSchemeEnumT_v02 loc_encoding);
|
||||
|
||||
/*convert NI notify verify type from QMI LOC to loc eng format*/
|
||||
bool convertNiNotifyVerifyType (GpsNiNotification *notif,
|
||||
qmiLocNiNotifyVerifyEnumT_v02 notif_priv);
|
||||
|
||||
/* close Loc API V02 client */
|
||||
int deInitLocClient();
|
||||
|
||||
/* convert position report to loc eng format and send the converted
|
||||
position to loc eng */
|
||||
void reportPosition
|
||||
(const qmiLocEventPositionReportIndMsgT_v02 *location_report_ptr);
|
||||
|
||||
/* convert satellite report to loc eng format and send the converted
|
||||
report to loc eng */
|
||||
void reportSv (const qmiLocEventGnssSvInfoIndMsgT_v02 *gnss_report_ptr);
|
||||
|
||||
/* convert engine state report to loc eng format and send the converted
|
||||
report to loc eng */
|
||||
void reportEngineState (
|
||||
const qmiLocEventEngineStateIndMsgT_v02 *engine_state_ptr);
|
||||
|
||||
/* convert fix session report to loc eng format and send the converted
|
||||
report to loc eng */
|
||||
void reportFixSessionState (
|
||||
const qmiLocEventFixSessionStateIndMsgT_v02 *fix_session_state_ptr);
|
||||
|
||||
/* convert NMEA report to loc eng format and send the converted
|
||||
report to loc eng */
|
||||
void reportNmea (const qmiLocEventNmeaIndMsgT_v02 *nmea_report_ptr);
|
||||
|
||||
/* convert and report an ATL request to loc engine */
|
||||
void reportAtlRequest(
|
||||
const qmiLocEventLocationServerConnectionReqIndMsgT_v02
|
||||
*server_request_ptr);
|
||||
|
||||
/* convert and report NI request to loc eng */
|
||||
void reportNiRequest(
|
||||
const qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *ni_req_ptr);
|
||||
|
||||
public:
|
||||
LocApiV02Adapter(LocEng &locEng);
|
||||
~LocApiV02Adapter();
|
||||
|
||||
/* event callback registered with the loc_api v02 interface */
|
||||
void eventCb(locClientHandleType client_handle,
|
||||
uint32_t loc_event_id,
|
||||
locClientEventIndUnionType loc_event_payload);
|
||||
|
||||
/* error callback, this function handles the service unavailable
|
||||
error */
|
||||
void errorCb(locClientHandleType handle,
|
||||
locClientErrorEnumType errorId);
|
||||
|
||||
virtual enum loc_api_adapter_err reinit();
|
||||
|
||||
virtual enum loc_api_adapter_err startFix();
|
||||
|
||||
virtual enum loc_api_adapter_err stopFix();
|
||||
|
||||
virtual enum loc_api_adapter_err
|
||||
setPositionMode(const LocPosMode *mode);
|
||||
|
||||
virtual enum loc_api_adapter_err
|
||||
setTime(GpsUtcTime time, int64_t timeReference, int uncertainty);
|
||||
|
||||
virtual enum loc_api_adapter_err
|
||||
injectPosition(double latitude, double longitude, float accuracy);
|
||||
|
||||
virtual enum loc_api_adapter_err
|
||||
deleteAidingData(GpsAidingData f);
|
||||
|
||||
virtual enum loc_api_adapter_err
|
||||
informNiResponse(GpsUserResponseType userResponse,
|
||||
const void* passThroughData);
|
||||
|
||||
virtual enum loc_api_adapter_err
|
||||
setServer(const char* url, int len);
|
||||
virtual enum loc_api_adapter_err
|
||||
setServer(unsigned int ip, int port, LocServerType type);
|
||||
virtual enum loc_api_adapter_err
|
||||
setXtraData(char* data, int length);
|
||||
virtual enum loc_api_adapter_err
|
||||
requestXtraServer();
|
||||
virtual enum loc_api_adapter_err
|
||||
atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bear,
|
||||
AGpsType agpsType);
|
||||
virtual enum loc_api_adapter_err atlCloseStatus(int handle, int is_succ);
|
||||
virtual enum loc_api_adapter_err setSUPLVersion(uint32_t version);
|
||||
virtual enum loc_api_adapter_err setLPPConfig(uint32_t profile);
|
||||
|
||||
virtual enum loc_api_adapter_err
|
||||
setSensorControlConfig(int sensorUsage);
|
||||
|
||||
virtual enum loc_api_adapter_err
|
||||
setSensorProperties(bool gyroBiasVarianceRandomWalk_valid, float gyroBiasVarianceRandomWalk,
|
||||
bool accelBiasVarianceRandomWalk_valid, float accelBiasVarianceRandomWalk,
|
||||
bool angleBiasVarianceRandomWalk_valid, float angleBiasVarianceRandomWalk,
|
||||
bool rateBiasVarianceRandomWalk_valid, float rateBiasVarianceRandomWalk,
|
||||
bool velocityBiasVarianceRandomWalk_valid, float velocityBiasVarianceRandomWalk);
|
||||
|
||||
virtual enum loc_api_adapter_err
|
||||
setSensorPerfControlConfig(int controlMode, int accelSamplesPerBatch, int accelBatchesPerSec,
|
||||
int gyroSamplesPerBatch, int gyroBatchesPerSec,
|
||||
int accelSamplesPerBatchHigh, int accelBatchesPerSecHigh,
|
||||
int gyroSamplesPerBatchHigh, int gyroBatchesPerSecHigh, int algorithmConfig);
|
||||
virtual enum loc_api_adapter_err setExtPowerConfig(int isBatteryCharging);
|
||||
virtual enum loc_api_adapter_err setAGLONASSProtocol(unsigned long aGlonassProtocol);
|
||||
};
|
||||
|
||||
#endif //LOC_API_V_0_2_ADAPTER_H
|
|
@ -1,547 +0,0 @@
|
|||
/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation, nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <sys/time.h>
|
||||
#include <string.h>
|
||||
#include <pthread.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <loc_cfg.h>
|
||||
#include "loc_api_v02_client.h"
|
||||
#include "loc_api_sync_req.h"
|
||||
|
||||
/* Logging */
|
||||
// Uncomment to log verbose logs
|
||||
#define LOG_NDEBUG 1
|
||||
|
||||
// log debug logs
|
||||
#define LOG_NDDEBUG 1
|
||||
#define LOG_TAG "LocSvc_api_v02"
|
||||
#include "loc_util_log.h"
|
||||
|
||||
#define LOC_SYNC_REQ_BUFFER_SIZE 8
|
||||
#define GPS_CONF_FILE "/etc/gps.conf"
|
||||
pthread_mutex_t loc_sync_call_mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||
|
||||
static bool loc_sync_call_initialized = false;
|
||||
|
||||
typedef struct {
|
||||
pthread_mutex_t sync_req_lock;
|
||||
|
||||
/* Client ID */
|
||||
locClientHandleType client_handle;
|
||||
|
||||
/* waiting conditional variable */
|
||||
pthread_cond_t ind_arrived_cond;
|
||||
|
||||
/* Callback waiting data block, protected by loc_cb_data_mutex */
|
||||
bool ind_is_selected; /* is cb selected? */
|
||||
bool ind_is_waiting; /* is waiting? */
|
||||
bool ind_has_arrived; /* callback has arrived */
|
||||
uint32_t req_id; /* sync request */
|
||||
void *recv_ind_payload_ptr; /* received payload */
|
||||
uint32_t recv_ind_id; /* received ind */
|
||||
|
||||
} loc_sync_req_data_s_type;
|
||||
|
||||
typedef struct {
|
||||
bool in_use; /* at least one sync call is active */
|
||||
bool slot_in_use[LOC_SYNC_REQ_BUFFER_SIZE];
|
||||
loc_sync_req_data_s_type slots[LOC_SYNC_REQ_BUFFER_SIZE];
|
||||
} loc_sync_req_array_s_type;
|
||||
|
||||
/***************************************************************************
|
||||
* DATA FOR ASYNCHRONOUS RPC PROCESSING
|
||||
**************************************************************************/
|
||||
loc_sync_req_array_s_type loc_sync_array;
|
||||
|
||||
/*===========================================================================
|
||||
|
||||
FUNCTION loc_sync_req_init
|
||||
|
||||
DESCRIPTION
|
||||
Initialize this module
|
||||
|
||||
DEPENDENCIES
|
||||
N/A
|
||||
|
||||
RETURN VALUE
|
||||
none
|
||||
|
||||
SIDE EFFECTS
|
||||
N/A
|
||||
|
||||
===========================================================================*/
|
||||
void loc_sync_req_init()
|
||||
{
|
||||
LOC_LOGV(" %s:%d]:\n", __func__, __LINE__);
|
||||
UTIL_READ_CONF_DEFAULT(GPS_CONF_FILE);
|
||||
pthread_mutex_lock(&loc_sync_call_mutex);
|
||||
if(true == loc_sync_call_initialized)
|
||||
{
|
||||
LOC_LOGD("%s:%d]:already initialized\n", __func__, __LINE__);
|
||||
pthread_mutex_unlock(&loc_sync_call_mutex);
|
||||
return;
|
||||
}
|
||||
|
||||
loc_sync_array.in_use = false;
|
||||
|
||||
memset(loc_sync_array.slot_in_use, 0, sizeof(loc_sync_array.slot_in_use));
|
||||
|
||||
int i;
|
||||
for (i = 0; i < LOC_SYNC_REQ_BUFFER_SIZE; i++)
|
||||
{
|
||||
loc_sync_req_data_s_type *slot = &loc_sync_array.slots[i];
|
||||
|
||||
pthread_mutex_init(&slot->sync_req_lock, NULL);
|
||||
pthread_cond_init(&slot->ind_arrived_cond, NULL);
|
||||
|
||||
slot->client_handle = LOC_CLIENT_INVALID_HANDLE_VALUE;
|
||||
slot->ind_is_selected = false; /* is ind selected? */
|
||||
slot->ind_is_waiting = false; /* is waiting? */
|
||||
slot->ind_has_arrived = false; /* callback has arrived */
|
||||
slot->recv_ind_id = 0; /* ind to wait for */
|
||||
slot->recv_ind_payload_ptr = NULL;
|
||||
slot->req_id = 0; /* req id */
|
||||
}
|
||||
|
||||
loc_sync_call_initialized = true;
|
||||
pthread_mutex_unlock(&loc_sync_call_mutex);
|
||||
}
|
||||
|
||||
|
||||
/*===========================================================================
|
||||
|
||||
FUNCTION loc_sync_process_ind
|
||||
|
||||
DESCRIPTION
|
||||
Wakes up blocked API calls to check if the needed callback has arrived
|
||||
|
||||
DEPENDENCIES
|
||||
N/A
|
||||
|
||||
RETURN VALUE
|
||||
none
|
||||
|
||||
SIDE EFFECTS
|
||||
N/A
|
||||
|
||||
===========================================================================*/
|
||||
void loc_sync_process_ind(
|
||||
locClientHandleType client_handle, /* handle of the client */
|
||||
uint32_t ind_id , /* ind id */
|
||||
void *ind_payload_ptr /* payload */
|
||||
)
|
||||
{
|
||||
|
||||
LOC_LOGV("%s:%d]: received indication, handle = %p ind_id = %u \n",
|
||||
__func__,__LINE__, client_handle, ind_id);
|
||||
|
||||
pthread_mutex_lock(&loc_sync_call_mutex);
|
||||
|
||||
if (!loc_sync_array.in_use)
|
||||
{
|
||||
LOC_LOGD("%s:%d]: loc_sync_array not in use \n",
|
||||
__func__, __LINE__);
|
||||
pthread_mutex_unlock(&loc_sync_call_mutex);
|
||||
return;
|
||||
}
|
||||
|
||||
bool in_use = false, consumed = false;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < LOC_SYNC_REQ_BUFFER_SIZE && !consumed; i++)
|
||||
{
|
||||
loc_sync_req_data_s_type *slot = &loc_sync_array.slots[i];
|
||||
|
||||
in_use |= loc_sync_array.slot_in_use[i];
|
||||
|
||||
pthread_mutex_lock(&slot->sync_req_lock);
|
||||
|
||||
if ( (loc_sync_array.slot_in_use[i]) && (slot->client_handle == client_handle)
|
||||
&& (ind_id == slot->recv_ind_id) && (!slot->ind_has_arrived))
|
||||
{
|
||||
// copy the payload to the slot waiting for this ind
|
||||
size_t payload_size = 0;
|
||||
|
||||
LOC_LOGV("%s:%d]: found slot %d selected for ind %u \n",
|
||||
__func__, __LINE__, i, ind_id);
|
||||
|
||||
if(true == locClientGetSizeByRespIndId(ind_id, &payload_size) &&
|
||||
NULL != slot->recv_ind_payload_ptr && NULL != ind_payload_ptr)
|
||||
{
|
||||
LOC_LOGV("%s:%d]: copying ind payload size = %u \n",
|
||||
__func__, __LINE__, payload_size);
|
||||
|
||||
memcpy(slot->recv_ind_payload_ptr, ind_payload_ptr, payload_size);
|
||||
|
||||
consumed = true;
|
||||
|
||||
}
|
||||
/* Received a callback while waiting, wake up thread to check it */
|
||||
if (slot->ind_is_waiting)
|
||||
{
|
||||
slot->recv_ind_id = ind_id;
|
||||
|
||||
pthread_cond_signal(&slot->ind_arrived_cond);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* If callback arrives before wait, remember it */
|
||||
LOC_LOGV("%s:%d]: ind %u arrived before wait was called \n",
|
||||
__func__, __LINE__, ind_id);
|
||||
|
||||
slot->ind_has_arrived = true;
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&slot->sync_req_lock);
|
||||
}
|
||||
|
||||
if (!in_use) {
|
||||
loc_sync_array.in_use = false;
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&loc_sync_call_mutex);
|
||||
}
|
||||
|
||||
/*===========================================================================
|
||||
|
||||
FUNCTION loc_alloc_slot
|
||||
|
||||
DESCRIPTION
|
||||
Allocates a buffer slot for the synchronous API call
|
||||
|
||||
DEPENDENCIES
|
||||
N/A
|
||||
|
||||
RETURN VALUE
|
||||
Select ID (>=0) : successful
|
||||
-1 : buffer full
|
||||
|
||||
SIDE EFFECTS
|
||||
N/A
|
||||
|
||||
===========================================================================*/
|
||||
static int loc_alloc_slot()
|
||||
{
|
||||
int i, select_id = -1; /* no free buffer */
|
||||
|
||||
pthread_mutex_lock(&loc_sync_call_mutex);
|
||||
|
||||
for (i = 0; i < LOC_SYNC_REQ_BUFFER_SIZE; i++)
|
||||
{
|
||||
if (!loc_sync_array.slot_in_use[i])
|
||||
{
|
||||
select_id = i;
|
||||
loc_sync_array.slot_in_use[i] = 1;
|
||||
loc_sync_array.in_use = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&loc_sync_call_mutex);
|
||||
LOC_LOGV("%s:%d]: returning slot %d\n",
|
||||
__func__, __LINE__, select_id);
|
||||
return select_id;
|
||||
}
|
||||
|
||||
/*===========================================================================
|
||||
|
||||
FUNCTION loc_free_slot
|
||||
|
||||
DESCRIPTION
|
||||
Frees a buffer slot after the synchronous API call
|
||||
|
||||
DEPENDENCIES
|
||||
N/A
|
||||
|
||||
RETURN VALUE
|
||||
None
|
||||
|
||||
SIDE EFFECTS
|
||||
N/A
|
||||
|
||||
===========================================================================*/
|
||||
static void loc_free_slot(int select_id)
|
||||
{
|
||||
int i;
|
||||
loc_sync_req_data_s_type *slot;
|
||||
|
||||
pthread_mutex_lock(&loc_sync_call_mutex);
|
||||
|
||||
LOC_LOGD("%s:%d]: freeing slot %d\n", __func__, __LINE__, select_id);
|
||||
|
||||
loc_sync_array.slot_in_use[select_id] = 0;
|
||||
|
||||
slot = &loc_sync_array.slots[select_id];
|
||||
|
||||
slot->client_handle = LOC_CLIENT_INVALID_HANDLE_VALUE;
|
||||
slot->ind_is_selected = false; /* is ind selected? */
|
||||
slot->ind_is_waiting = false; /* is waiting? */
|
||||
slot->ind_has_arrived = false; /* callback has arrived */
|
||||
slot->recv_ind_id = 0; /* ind to wait for */
|
||||
slot->recv_ind_payload_ptr = NULL;
|
||||
slot->req_id = 0;
|
||||
|
||||
// check if all slots are now free
|
||||
for (i = 0; i < LOC_SYNC_REQ_BUFFER_SIZE; i++)
|
||||
{
|
||||
if (loc_sync_array.slot_in_use[i]) break;
|
||||
}
|
||||
|
||||
if (i >= LOC_SYNC_REQ_BUFFER_SIZE)
|
||||
{
|
||||
loc_sync_array.in_use = false;
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&loc_sync_call_mutex);
|
||||
}
|
||||
|
||||
/*===========================================================================
|
||||
|
||||
FUNCTION loc_sync_select_ind
|
||||
|
||||
DESCRIPTION
|
||||
Selects which indication to wait for.
|
||||
|
||||
|
||||
DEPENDENCIES
|
||||
N/A
|
||||
|
||||
RETURN VALUE
|
||||
Select ID (>=0) : successful
|
||||
-ENOMEM : out of buffer
|
||||
|
||||
SIDE EFFECTS
|
||||
N/A
|
||||
|
||||
===========================================================================*/
|
||||
static int loc_sync_select_ind(
|
||||
locClientHandleType client_handle, /* Client handle */
|
||||
uint32_t ind_id, /* ind Id wait for */
|
||||
uint32_t req_id, /* req id */
|
||||
void * ind_payload_ptr /* ptr where payload should be copied to*/
|
||||
)
|
||||
{
|
||||
int select_id = loc_alloc_slot();
|
||||
|
||||
LOC_LOGV("%s:%d]: client handle %p, ind_id %u, req_id %u \n",
|
||||
__func__, __LINE__, client_handle, ind_id, req_id);
|
||||
|
||||
if (select_id < 0)
|
||||
{
|
||||
LOC_LOGE("%s:%d]: buffer full for this synchronous req %s \n",
|
||||
__func__, __LINE__, loc_get_v02_event_name(req_id));
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
loc_sync_req_data_s_type *slot = &loc_sync_array.slots[select_id];
|
||||
|
||||
pthread_mutex_lock(&slot->sync_req_lock);
|
||||
|
||||
slot->client_handle = client_handle;
|
||||
slot->ind_is_selected = true;
|
||||
slot->ind_is_waiting = false;
|
||||
slot->ind_has_arrived = false;
|
||||
|
||||
slot->recv_ind_id = ind_id;
|
||||
slot->req_id = req_id;
|
||||
slot->recv_ind_payload_ptr = ind_payload_ptr; //store the payload ptr
|
||||
|
||||
pthread_mutex_unlock(&slot->sync_req_lock);
|
||||
|
||||
return select_id;
|
||||
}
|
||||
|
||||
|
||||
/*===========================================================================
|
||||
|
||||
FUNCTION loc_sync_wait_for_ind
|
||||
|
||||
DESCRIPTION
|
||||
Waits for a selected indication. The wait expires in timeout_seconds seconds.
|
||||
If the function is called before an existing wait has finished, it will
|
||||
immediately return error.
|
||||
|
||||
DEPENDENCIES
|
||||
N/A
|
||||
|
||||
RETURN VALUE
|
||||
0 on SUCCESS, -ve value on failure
|
||||
|
||||
SIDE EFFECTS
|
||||
N/A
|
||||
|
||||
===========================================================================*/
|
||||
static int loc_sync_wait_for_ind(
|
||||
int select_id, /* ID from loc_sync_select_ind() */
|
||||
int timeout_seconds, /* Timeout in this number of seconds */
|
||||
uint32_t ind_id
|
||||
)
|
||||
{
|
||||
if (select_id < 0 || select_id >= LOC_SYNC_REQ_BUFFER_SIZE || !loc_sync_array.slot_in_use[select_id])
|
||||
{
|
||||
LOC_LOGE("%s:%d]: invalid select_id: %d \n",
|
||||
__func__, __LINE__, select_id);
|
||||
|
||||
return (-EINVAL);
|
||||
}
|
||||
|
||||
loc_sync_req_data_s_type *slot = &loc_sync_array.slots[select_id];
|
||||
|
||||
int ret_val = 0; /* the return value of this function: 0 = no error */
|
||||
int rc; /* return code from pthread calls */
|
||||
|
||||
struct timeval present_time;
|
||||
struct timespec expire_time;
|
||||
|
||||
pthread_mutex_lock(&slot->sync_req_lock);
|
||||
|
||||
do
|
||||
{
|
||||
if (slot->ind_has_arrived)
|
||||
{
|
||||
ret_val = 0; /* success */
|
||||
break;
|
||||
}
|
||||
|
||||
if (slot->ind_is_waiting)
|
||||
{
|
||||
LOC_LOGW("%s:%d]: already waiting in this slot %d\n", __func__,
|
||||
__LINE__, select_id);
|
||||
ret_val = -EBUSY; // busy
|
||||
break;
|
||||
}
|
||||
|
||||
/* Calculate absolute expire time */
|
||||
gettimeofday(&present_time, NULL);
|
||||
expire_time.tv_sec = present_time.tv_sec;
|
||||
expire_time.tv_nsec = present_time.tv_usec * 1000;
|
||||
expire_time.tv_sec += timeout_seconds;
|
||||
|
||||
/* Take new wait request */
|
||||
slot->ind_is_waiting = true;
|
||||
|
||||
/* Waiting */
|
||||
rc = pthread_cond_timedwait(&slot->ind_arrived_cond,
|
||||
&slot->sync_req_lock, &expire_time);
|
||||
|
||||
slot->ind_is_waiting = false;
|
||||
|
||||
if(rc == ETIMEDOUT)
|
||||
{
|
||||
LOC_LOGE("%s:%d]: slot %d, timed out for ind_id %s\n",
|
||||
__func__, __LINE__, select_id, loc_get_v02_event_name(ind_id));
|
||||
ret_val = -ETIMEDOUT; //time out
|
||||
}
|
||||
|
||||
} while (0);
|
||||
|
||||
pthread_mutex_unlock(&slot->sync_req_lock);
|
||||
loc_free_slot(select_id);
|
||||
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
/*===========================================================================
|
||||
|
||||
FUNCTION loc_sync_send_req
|
||||
|
||||
DESCRIPTION
|
||||
Synchronous req call (thread safe)
|
||||
|
||||
DEPENDENCIES
|
||||
N/A
|
||||
|
||||
RETURN VALUE
|
||||
Loc API 2.0 status
|
||||
|
||||
SIDE EFFECTS
|
||||
N/A
|
||||
|
||||
===========================================================================*/
|
||||
locClientStatusEnumType loc_sync_send_req
|
||||
(
|
||||
locClientHandleType client_handle,
|
||||
uint32_t req_id, /* req id */
|
||||
locClientReqUnionType req_payload,
|
||||
uint32_t timeout_msec,
|
||||
uint32_t ind_id, //ind ID to block for, usually the same as req_id */
|
||||
void *ind_payload_ptr /* can be NULL*/
|
||||
)
|
||||
{
|
||||
locClientStatusEnumType status = eLOC_CLIENT_SUCCESS ;
|
||||
int select_id;
|
||||
int rc = 0;
|
||||
|
||||
// Select the callback we are waiting for
|
||||
select_id = loc_sync_select_ind(client_handle, ind_id, req_id,
|
||||
ind_payload_ptr);
|
||||
|
||||
if (select_id >= 0)
|
||||
{
|
||||
status = locClientSendReq (client_handle, req_id, req_payload);
|
||||
LOC_LOGV("%s:%d]: select_id = %d,locClientSendReq returned %d\n",
|
||||
__func__, __LINE__, select_id, status);
|
||||
|
||||
if (status != eLOC_CLIENT_SUCCESS )
|
||||
{
|
||||
loc_free_slot(select_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Wait for the indication callback
|
||||
if (( rc = loc_sync_wait_for_ind( select_id,
|
||||
timeout_msec / 1000,
|
||||
ind_id) ) < 0)
|
||||
{
|
||||
if ( rc == -ETIMEDOUT)
|
||||
status = eLOC_CLIENT_FAILURE_TIMEOUT;
|
||||
else
|
||||
status = eLOC_CLIENT_FAILURE_INTERNAL;
|
||||
|
||||
// Callback waiting failed
|
||||
LOC_LOGE("%s:%d]: loc_api_wait_for_ind failed, err %d, "
|
||||
"select id %d, status %s", __func__, __LINE__, rc ,
|
||||
select_id, loc_get_v02_client_status_name(status));
|
||||
}
|
||||
else
|
||||
{
|
||||
status = eLOC_CLIENT_SUCCESS;
|
||||
LOC_LOGV("%s:%d]: success (select id %d)\n",
|
||||
__func__, __LINE__, select_id);
|
||||
}
|
||||
}
|
||||
} /* select id */
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
|
@ -1,68 +0,0 @@
|
|||
/* Copyright (c) 2011, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef LOC_SYNC_REQ_H
|
||||
#define LOC_SYNC_REQ_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "loc_api_v02_client.h"
|
||||
|
||||
#define LOC_ENGINE_SYNC_REQUEST_TIMEOUT (1000) // 1 second
|
||||
|
||||
/* Init function */
|
||||
extern void loc_sync_req_init();
|
||||
|
||||
|
||||
/* Process Loc API indications to wake up blocked user threads */
|
||||
extern void loc_sync_process_ind(
|
||||
locClientHandleType client_handle, /* handle of the client */
|
||||
uint32_t ind_id , /* respInd id */
|
||||
void *ind_payload_ptr /* payload */
|
||||
);
|
||||
|
||||
/* Thread safe synchronous request, using Loc API status return code */
|
||||
extern locClientStatusEnumType loc_sync_send_req
|
||||
(
|
||||
locClientHandleType client_handle,
|
||||
uint32_t req_id, /* req id */
|
||||
locClientReqUnionType req_payload,
|
||||
uint32_t timeout_msec,
|
||||
uint32_t ind_id, //ind ID to block for, usually the same as req_id */
|
||||
void *ind_payload_ptr /* can be NULL*/
|
||||
);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* LOC_SYNC_REQ_H */
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,293 +0,0 @@
|
|||
/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation, nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
#include <loc_api_v02_log.h>
|
||||
#include <location_service_v02.h>
|
||||
|
||||
static loc_name_val_s_type loc_v02_event_name[] =
|
||||
{
|
||||
NAME_VAL(QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_INFORM_CLIENT_REVISION_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_REG_EVENTS_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_REG_EVENTS_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_START_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_START_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_STOP_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_STOP_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_POSITION_REPORT_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_NMEA_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_ENGINE_STATE_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_WIFI_REQ_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02),
|
||||
NAME_VAL(QMI_LOC_GET_SERVICE_REVISION_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_SERVICE_REVISION_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_GET_SERVICE_REVISION_IND_V02),
|
||||
NAME_VAL(QMI_LOC_GET_FIX_CRITERIA_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_FIX_CRITERIA_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_GET_FIX_CRITERIA_IND_V02),
|
||||
NAME_VAL(QMI_LOC_NI_USER_RESPONSE_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_NI_USER_RESPONSE_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_NI_USER_RESPONSE_IND_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02),
|
||||
NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02),
|
||||
NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_UTC_TIME_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_UTC_TIME_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_UTC_TIME_IND_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_POSITION_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_POSITION_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_POSITION_IND_V02),
|
||||
NAME_VAL(QMI_LOC_SET_ENGINE_LOCK_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_SET_ENGINE_LOCK_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_SET_ENGINE_LOCK_IND_V02),
|
||||
NAME_VAL(QMI_LOC_GET_ENGINE_LOCK_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_ENGINE_LOCK_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_GET_ENGINE_LOCK_IND_V02),
|
||||
NAME_VAL(QMI_LOC_SET_SBAS_CONFIG_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_SET_SBAS_CONFIG_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_SET_SBAS_CONFIG_IND_V02),
|
||||
NAME_VAL(QMI_LOC_GET_SBAS_CONFIG_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_SBAS_CONFIG_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_GET_SBAS_CONFIG_IND_V02),
|
||||
NAME_VAL(QMI_LOC_SET_NMEA_TYPES_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_SET_NMEA_TYPES_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_SET_NMEA_TYPES_IND_V02),
|
||||
NAME_VAL(QMI_LOC_GET_NMEA_TYPES_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_NMEA_TYPES_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_GET_NMEA_TYPES_IND_V02),
|
||||
NAME_VAL(QMI_LOC_SET_LOW_POWER_MODE_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_SET_LOW_POWER_MODE_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_SET_LOW_POWER_MODE_IND_V02),
|
||||
NAME_VAL(QMI_LOC_GET_LOW_POWER_MODE_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_LOW_POWER_MODE_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_GET_LOW_POWER_MODE_IND_V02),
|
||||
NAME_VAL(QMI_LOC_SET_SERVER_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_SET_SERVER_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_SET_SERVER_IND_V02),
|
||||
NAME_VAL(QMI_LOC_GET_SERVER_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_SERVER_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_GET_SERVER_IND_V02),
|
||||
NAME_VAL(QMI_LOC_DELETE_ASSIST_DATA_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_DELETE_ASSIST_DATA_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_DELETE_ASSIST_DATA_IND_V02),
|
||||
NAME_VAL(QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_SET_XTRA_T_SESSION_CONTROL_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02),
|
||||
NAME_VAL(QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_XTRA_T_SESSION_CONTROL_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_WIFI_POSITION_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_WIFI_POSITION_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_WIFI_POSITION_IND_V02),
|
||||
NAME_VAL(QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_NOTIFY_WIFI_STATUS_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02),
|
||||
NAME_VAL(QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_REGISTERED_EVENTS_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_GET_REGISTERED_EVENTS_IND_V02),
|
||||
NAME_VAL(QMI_LOC_SET_OPERATION_MODE_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_SET_OPERATION_MODE_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_SET_OPERATION_MODE_IND_V02),
|
||||
NAME_VAL(QMI_LOC_GET_OPERATION_MODE_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_OPERATION_MODE_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_GET_OPERATION_MODE_IND_V02),
|
||||
NAME_VAL(QMI_LOC_SET_SPI_STATUS_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_SET_SPI_STATUS_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_SET_SPI_STATUS_IND_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_SENSOR_DATA_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_SENSOR_DATA_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_SENSOR_DATA_IND_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_TIME_SYNC_DATA_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02),
|
||||
NAME_VAL(QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_SET_CRADLE_MOUNT_CONFIG_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02),
|
||||
NAME_VAL(QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_CRADLE_MOUNT_CONFIG_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02),
|
||||
NAME_VAL(QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_SET_EXTERNAL_POWER_CONFIG_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02),
|
||||
NAME_VAL(QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_EXTERNAL_POWER_CONFIG_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02),
|
||||
NAME_VAL(QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02),
|
||||
NAME_VAL(QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02),
|
||||
NAME_VAL(QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02),
|
||||
NAME_VAL(QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_SET_SENSOR_CONTROL_CONFIG_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02),
|
||||
NAME_VAL(QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_SENSOR_CONTROL_CONFIG_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02),
|
||||
NAME_VAL(QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_SET_SENSOR_PROPERTIES_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02),
|
||||
NAME_VAL(QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_SENSOR_PROPERTIES_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02),
|
||||
NAME_VAL(QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02),
|
||||
NAME_VAL(QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_SUPL_CERTIFICATE_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02),
|
||||
NAME_VAL(QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_DELETE_SUPL_CERTIFICATE_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02),
|
||||
NAME_VAL(QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02),
|
||||
NAME_VAL(QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_NI_GEOFENCE_NOTIFICATION_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_GEOFENCE_GEN_ALERT_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_GEOFENCE_BREACH_NOTIFICATION_IND_V02),
|
||||
NAME_VAL(QMI_LOC_ADD_CIRCULAR_GEOFENCE_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_ADD_CIRCULAR_GEOFENCE_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02),
|
||||
NAME_VAL(QMI_LOC_DELETE_GEOFENCE_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_DELETE_GEOFENCE_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_DELETE_GEOFENCE_IND_V02),
|
||||
NAME_VAL(QMI_LOC_QUERY_GEOFENCE_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_QUERY_GEOFENCE_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_QUERY_GEOFENCE_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EDIT_GEOFENCE_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_EDIT_GEOFENCE_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_EDIT_GEOFENCE_IND_V02),
|
||||
NAME_VAL(QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_BEST_AVAILABLE_POSITION_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_MOTION_DATA_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_MOTION_DATA_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_MOTION_DATA_IND_V02),
|
||||
NAME_VAL(QMI_LOC_GET_NI_GEOFENCE_ID_LIST_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_NI_GEOFENCE_ID_LIST_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_GSM_CELL_INFO_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_GSM_CELL_INFO_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_GSM_CELL_INFO_IND_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_IND_V02),
|
||||
NAME_VAL(QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_PEDOMETER_CONTROL_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_MOTION_DATA_CONTROL_IND_V02),
|
||||
NAME_VAL(QMI_LOC_PEDOMETER_REPORT_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_PEDOMETER_REPORT_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_PEDOMETER_REPORT_IND_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_WCDMA_CELL_INFO_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_WCDMA_CELL_INFO_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_WCDMA_CELL_INFO_IND_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_TDSCDMA_CELL_INFO_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_TDSCDMA_CELL_INFO_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_TDSCDMA_CELL_INFO_IND_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_SUBSCRIBER_ID_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_SUBSCRIBER_ID_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_SUBSCRIBER_ID_IND_V02)
|
||||
};
|
||||
static int loc_v02_event_num = sizeof(loc_v02_event_name) / sizeof(loc_name_val_s_type);
|
||||
|
||||
const char* loc_get_v02_event_name(uint32_t event)
|
||||
{
|
||||
return loc_get_name_from_val(loc_v02_event_name, loc_v02_event_num, (long) event);
|
||||
}
|
||||
|
||||
static loc_name_val_s_type loc_v02_client_status_name[] =
|
||||
{
|
||||
NAME_VAL(eLOC_CLIENT_SUCCESS),
|
||||
NAME_VAL(eLOC_CLIENT_FAILURE_GENERAL),
|
||||
NAME_VAL(eLOC_CLIENT_FAILURE_UNSUPPORTED),
|
||||
NAME_VAL(eLOC_CLIENT_FAILURE_INVALID_PARAMETER),
|
||||
NAME_VAL(eLOC_CLIENT_FAILURE_ENGINE_BUSY),
|
||||
NAME_VAL(eLOC_CLIENT_FAILURE_PHONE_OFFLINE),
|
||||
NAME_VAL(eLOC_CLIENT_FAILURE_TIMEOUT),
|
||||
NAME_VAL(eLOC_CLIENT_FAILURE_SERVICE_NOT_PRESENT),
|
||||
NAME_VAL(eLOC_CLIENT_FAILURE_SERVICE_VERSION_UNSUPPORTED),
|
||||
NAME_VAL(eLOC_CLIENT_FAILURE_CLIENT_VERSION_UNSUPPORTED),
|
||||
NAME_VAL(eLOC_CLIENT_FAILURE_INVALID_HANDLE),
|
||||
NAME_VAL(eLOC_CLIENT_FAILURE_INTERNAL),
|
||||
NAME_VAL(eLOC_CLIENT_FAILURE_NOT_INITIALIZED),
|
||||
NAME_VAL(eLOC_CLIENT_FAILURE_NOT_ENOUGH_MEMORY),
|
||||
};
|
||||
static int loc_v02_client_status_num = sizeof(loc_v02_client_status_name) / sizeof(loc_name_val_s_type);
|
||||
|
||||
const char* loc_get_v02_client_status_name(locClientStatusEnumType status)
|
||||
{
|
||||
return loc_get_name_from_val(loc_v02_client_status_name, loc_v02_client_status_num, (long) status);
|
||||
}
|
||||
|
||||
|
||||
static loc_name_val_s_type loc_v02_qmi_status_name[] =
|
||||
{
|
||||
QMILOCSTATUSENUMT_MIN_ENUM_VAL_V02,
|
||||
eQMI_LOC_SUCCESS_V02,
|
||||
eQMI_LOC_GENERAL_FAILURE_V02,
|
||||
eQMI_LOC_UNSUPPORTED_V02,
|
||||
eQMI_LOC_INVALID_PARAMETER_V02,
|
||||
eQMI_LOC_ENGINE_BUSY_V02,
|
||||
eQMI_LOC_PHONE_OFFLINE_V02,
|
||||
eQMI_LOC_TIMEOUT_V02,
|
||||
eQMI_LOC_CONFIG_NOT_SUPPORTED_V02,
|
||||
eQMI_LOC_INSUFFICIENT_MEMORY_V02,
|
||||
QMILOCSTATUSENUMT_MAX_ENUM_VAL_V02
|
||||
};
|
||||
static int loc_v02_qmi_status_num = sizeof(loc_v02_qmi_status_name) / sizeof(loc_name_val_s_type);
|
||||
|
||||
const char* loc_get_v02_qmi_status_name(qmiLocStatusEnumT_v02 status)
|
||||
{
|
||||
return loc_get_name_from_val(loc_v02_qmi_status_name, loc_v02_qmi_status_num, (long) status);
|
||||
}
|
|
@ -1,50 +0,0 @@
|
|||
/* Copyright (c) 2011, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LOC_API_V02_LOG_H
|
||||
#define LOC_API_V02_LOG_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include <loc_log.h>
|
||||
#include <loc_api_v02_client.h>
|
||||
|
||||
const char* loc_get_v02_event_name(uint32_t event);
|
||||
const char* loc_get_v02_client_status_name(locClientStatusEnumType status);
|
||||
const char* loc_get_v02_qmi_status_name(qmiLocStatusEnumT_v02 status);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* LOC_API_V02_LOG_H */
|
|
@ -1,75 +0,0 @@
|
|||
/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation, nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#ifndef LOC_UTIL_LOG_H
|
||||
#define LOC_UTIL_LOG_H
|
||||
|
||||
#if defined(_ANDROID_)
|
||||
#include "loc_api_v02_log.h"
|
||||
#include <log_util.h>
|
||||
|
||||
#else // no _ANDROID_
|
||||
|
||||
// common for QNX and Griffon
|
||||
|
||||
//error logs
|
||||
#define LOC_LOGE(...) printf(__VA_ARGS__)
|
||||
//warning logs
|
||||
#define LOC_LOGW(...) printf(__VA_ARGS__)
|
||||
// debug logs
|
||||
#define LOC_LOGD(...) printf(__VA_ARGS__)
|
||||
//info logs
|
||||
#define LOC_LOGI(...) printf(__VA_ARGS__)
|
||||
//verbose logs
|
||||
#define LOC_LOGV(...) printf(__VA_ARGS__)
|
||||
|
||||
#define MODEM_LOG_CALLFLOW(SPEC, VAL)
|
||||
#define EXIT_LOG_CALLFLOW(SPEC, VAL)
|
||||
|
||||
#define loc_get_v02_event_name(X) #X
|
||||
#define loc_get_v02_client_status_name(X) #X
|
||||
|
||||
#define loc_get_v02_qmi_status_name(X) #X
|
||||
|
||||
//specific to OFF TARGET
|
||||
#ifdef LOC_UTIL_TARGET_OFF_TARGET
|
||||
|
||||
#include <stdio.h>
|
||||
# include <asm/errno.h>
|
||||
# include <sys/time.h>
|
||||
|
||||
// get around strl*: not found in glibc
|
||||
// TBD:look for presence of eglibc other libraries
|
||||
// with strlcpy supported.
|
||||
#define strlcpy(X,Y,Z) strcpy(X,Y)
|
||||
#define strlcat(X,Y,Z) strcat(X,Y)
|
||||
|
||||
#endif //LOC_UTIL_TARGET_OFF_TARGET
|
||||
|
||||
#endif //_ANDROID_
|
||||
|
||||
#endif //LOC_UTIL_LOG_H
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue