Fix merge damage.
This commit is contained in:
parent
cb9f83cecd
commit
caff225a0b
14 changed files with 0 additions and 20309 deletions
|
@ -1,49 +0,0 @@
|
||||||
ifneq ($(BUILD_TINY_ANDROID),true)
|
|
||||||
|
|
||||||
LOCAL_PATH := $(call my-dir)
|
|
||||||
|
|
||||||
include $(CLEAR_VARS)
|
|
||||||
|
|
||||||
LOCAL_MODULE := libds_api
|
|
||||||
|
|
||||||
LOCAL_MODULE_TAGS := optional
|
|
||||||
|
|
||||||
LOCAL_SHARED_LIBRARIES := \
|
|
||||||
libutils \
|
|
||||||
libcutils \
|
|
||||||
libqmi_cci \
|
|
||||||
libqmi_csi \
|
|
||||||
libqmi_common_so \
|
|
||||||
libgps.utils \
|
|
||||||
libdsi_netctrl \
|
|
||||||
libqmiservices
|
|
||||||
|
|
||||||
|
|
||||||
LOCAL_SRC_FILES += \
|
|
||||||
ds_client.c
|
|
||||||
|
|
||||||
LOCAL_CFLAGS += \
|
|
||||||
-fno-short-enums \
|
|
||||||
-D_ANDROID_
|
|
||||||
|
|
||||||
LOCAL_COPY_HEADERS_TO:= ds_api/
|
|
||||||
|
|
||||||
LOCAL_COPY_HEADERS:= \
|
|
||||||
ds_client.h
|
|
||||||
|
|
||||||
LOCAL_LDFLAGS += -Wl,--export-dynamic
|
|
||||||
|
|
||||||
## Includes
|
|
||||||
LOCAL_C_INCLUDES := \
|
|
||||||
$(TARGET_OUT_HEADERS)/libloc_eng \
|
|
||||||
$(TARGET_OUT_HEADERS)/qmi-framework/inc \
|
|
||||||
$(TARGET_OUT_HEADERS)/qmi/inc \
|
|
||||||
$(TARGET_OUT_HEADERS)/gps.utils \
|
|
||||||
$(TARGET_OUT_HEADERS)/data/inc
|
|
||||||
|
|
||||||
|
|
||||||
LOCAL_PRELINK_MODULE := false
|
|
||||||
|
|
||||||
include $(BUILD_SHARED_LIBRARY)
|
|
||||||
|
|
||||||
endif # not BUILD_TINY_ANDROID
|
|
|
@ -1,704 +0,0 @@
|
||||||
/* Copyright (c) 2013, The Linux Foundation. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions are
|
|
||||||
* met:
|
|
||||||
* * Redistributions of source code must retain the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer.
|
|
||||||
* * Redistributions in binary form must reproduce the above
|
|
||||||
* copyright notice, this list of conditions and the following
|
|
||||||
* disclaimer in the documentation and/or other materials provided
|
|
||||||
* with the distribution.
|
|
||||||
* * Neither the name of The Linux Foundation, nor the names of its
|
|
||||||
* contributors may be used to endorse or promote products derived
|
|
||||||
* from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
|
||||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
|
||||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
||||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
||||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
|
||||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
|
||||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
|
||||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define LOG_NDEBUG 0
|
|
||||||
#define LOG_TAG "LocSvc_ds_client"
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <stdbool.h>
|
|
||||||
#include <stddef.h>
|
|
||||||
#include <wireless_data_service_v01.h>
|
|
||||||
#include <utils/Log.h>
|
|
||||||
#include <log_util.h>
|
|
||||||
#include <loc_log.h>
|
|
||||||
#include <qmi_client.h>
|
|
||||||
#include <qmi_idl_lib.h>
|
|
||||||
#include <qmi_cci_target_ext.h>
|
|
||||||
#include <qmi_cci_target.h>
|
|
||||||
#include <qmi_cci_common.h>
|
|
||||||
#include <dsi_netctrl.h>
|
|
||||||
#include <ds_client.h>
|
|
||||||
|
|
||||||
#include<sys/time.h>
|
|
||||||
|
|
||||||
//Timeout to wait for wds service notification from qmi
|
|
||||||
#define DS_CLIENT_SERVICE_TIMEOUT (4000)
|
|
||||||
//Max timeout for the service to come up
|
|
||||||
#define DS_CLIENT_SERVICE_TIMEOUT_TOTAL (40000)
|
|
||||||
//Timeout for the service to respond to sync msg
|
|
||||||
#define DS_CLIENT_SYNC_MSG_TIMEOUT (5000)
|
|
||||||
/*Request messages the WDS client can send to the WDS service*/
|
|
||||||
typedef union
|
|
||||||
{
|
|
||||||
/*Requests the service for a list of all profiles present*/
|
|
||||||
wds_get_profile_list_req_msg_v01 *p_get_profile_list_req;
|
|
||||||
/*Requests the service for a profile's settings*/
|
|
||||||
wds_get_profile_settings_req_msg_v01 *p_get_profile_settings_req;
|
|
||||||
}ds_client_req_union_type;
|
|
||||||
|
|
||||||
/*Response indications that are sent by the WDS service*/
|
|
||||||
typedef union
|
|
||||||
{
|
|
||||||
wds_get_profile_list_resp_msg_v01 *p_get_profile_list_resp;
|
|
||||||
wds_get_profile_settings_resp_msg_v01 *p_get_profile_setting_resp;
|
|
||||||
}ds_client_resp_union_type;
|
|
||||||
|
|
||||||
struct event_strings_s
|
|
||||||
{
|
|
||||||
char * str;
|
|
||||||
dsi_net_evt_t evt;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct event_strings_s event_string_tbl[DSI_EVT_MAX] =
|
|
||||||
{
|
|
||||||
NAME_VAL(DSI_EVT_INVALID),
|
|
||||||
NAME_VAL(DSI_EVT_NET_IS_CONN),
|
|
||||||
NAME_VAL(DSI_EVT_NET_NO_NET),
|
|
||||||
NAME_VAL(DSI_EVT_PHYSLINK_DOWN_STATE),
|
|
||||||
NAME_VAL(DSI_EVT_PHYSLINK_UP_STATE),
|
|
||||||
NAME_VAL(DSI_EVT_NET_RECONFIGURED),
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
ds_client_event_ind_cb_type event_cb;
|
|
||||||
void *caller_cookie;
|
|
||||||
}ds_caller_data;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
//Global dsi handle
|
|
||||||
dsi_hndl_t dsi_net_handle;
|
|
||||||
//Handle to caller's data
|
|
||||||
ds_caller_data caller_data;
|
|
||||||
} ds_client_session_data;
|
|
||||||
|
|
||||||
void net_ev_cb(dsi_hndl_t handle, void* user_data,
|
|
||||||
dsi_net_evt_t evt, dsi_evt_payload_t *payload_ptr)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
(void)handle;
|
|
||||||
(void)user_data;
|
|
||||||
(void)payload_ptr;
|
|
||||||
ds_caller_data *callback_data = (ds_caller_data *)user_data;
|
|
||||||
|
|
||||||
LOC_LOGD("%s:%d]:Enter\n", __func__, __LINE__);
|
|
||||||
|
|
||||||
if(evt > DSI_EVT_INVALID && evt < DSI_EVT_MAX)
|
|
||||||
{
|
|
||||||
for(i=0;i<DSI_EVT_MAX;i++)
|
|
||||||
{
|
|
||||||
if(event_string_tbl[i].evt == evt)
|
|
||||||
LOC_LOGE("%s:%d]: Callback received: %s",
|
|
||||||
__func__, __LINE__, event_string_tbl[i].str);
|
|
||||||
}
|
|
||||||
switch(evt) {
|
|
||||||
case DSI_EVT_NET_IS_CONN:
|
|
||||||
{
|
|
||||||
LOC_LOGD("%s:%d]: Emergency call started\n", __func__, __LINE__);
|
|
||||||
callback_data->event_cb(E_DS_CLIENT_DATA_CALL_CONNECTED,
|
|
||||||
callback_data->caller_cookie);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case DSI_EVT_NET_NO_NET:
|
|
||||||
{
|
|
||||||
LOC_LOGD("%s:%d]: Emergency call stopped\n", __func__, __LINE__);
|
|
||||||
callback_data->event_cb(E_DS_CLIENT_DATA_CALL_DISCONNECTED,
|
|
||||||
callback_data->caller_cookie);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
LOC_LOGD("%s:%d]: uninteresting event\n", __func__, __LINE__);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
LOC_LOGD("%s:%d]:Exit\n", __func__, __LINE__);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*This function is called to obtain a handle to the QMI WDS service*/
|
|
||||||
static ds_client_status_enum_type
|
|
||||||
ds_client_qmi_ctrl_point_init(qmi_client_type *p_wds_qmi_client)
|
|
||||||
{
|
|
||||||
qmi_client_type wds_qmi_client, notifier = NULL;
|
|
||||||
ds_client_status_enum_type status = E_DS_CLIENT_SUCCESS;
|
|
||||||
qmi_service_info *p_service_info = NULL;
|
|
||||||
uint32_t num_services = 0, num_entries = 0;
|
|
||||||
qmi_client_error_type ret = QMI_NO_ERR;
|
|
||||||
unsigned char no_signal = 0;
|
|
||||||
qmi_client_os_params os_params;
|
|
||||||
int timeout = 0;
|
|
||||||
|
|
||||||
LOC_LOGD("%s:%d]:Enter\n", __func__, __LINE__);
|
|
||||||
|
|
||||||
//Get service object for QMI_WDS service
|
|
||||||
qmi_idl_service_object_type ds_client_service_object =
|
|
||||||
wds_get_service_object_v01();
|
|
||||||
if(ds_client_service_object == NULL) {
|
|
||||||
LOC_LOGE("%s:%d]: wds_get_service_object_v01 failed\n" ,
|
|
||||||
__func__, __LINE__);
|
|
||||||
status = E_DS_CLIENT_FAILURE_INTERNAL;
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
|
|
||||||
//get service addressing information
|
|
||||||
ret = qmi_client_get_service_list(ds_client_service_object, NULL, NULL,
|
|
||||||
&num_services);
|
|
||||||
LOC_LOGD("%s:%d]: qmi_client_get_service_list() first try ret %d, "
|
|
||||||
"num_services %d]\n", __func__, __LINE__, ret, num_services);
|
|
||||||
if(ret != QMI_NO_ERR) {
|
|
||||||
//Register for service notification
|
|
||||||
ret = qmi_client_notifier_init(ds_client_service_object, &os_params, ¬ifier);
|
|
||||||
if (ret != QMI_NO_ERR) {
|
|
||||||
LOC_LOGE("%s:%d]: qmi_client_notifier_init failed %d\n",
|
|
||||||
__func__, __LINE__, ret);
|
|
||||||
status = E_DS_CLIENT_FAILURE_INTERNAL;
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
|
|
||||||
do {
|
|
||||||
QMI_CCI_OS_SIGNAL_CLEAR(&os_params);
|
|
||||||
ret = qmi_client_get_service_list(ds_client_service_object, NULL,
|
|
||||||
NULL, &num_services);
|
|
||||||
if(ret != QMI_NO_ERR) {
|
|
||||||
QMI_CCI_OS_SIGNAL_WAIT(&os_params, DS_CLIENT_SERVICE_TIMEOUT);
|
|
||||||
no_signal = QMI_CCI_OS_SIGNAL_TIMED_OUT(&os_params);
|
|
||||||
if(!no_signal)
|
|
||||||
ret = qmi_client_get_service_list(ds_client_service_object, NULL,
|
|
||||||
NULL, &num_services);
|
|
||||||
}
|
|
||||||
timeout += DS_CLIENT_SERVICE_TIMEOUT;
|
|
||||||
LOC_LOGV("%s:%d]: qmi_client_get_service_list() returned ret: %d,"
|
|
||||||
"no_signal: %d, total timeout: %d\n", __func__, __LINE__,
|
|
||||||
ret, no_signal, timeout);
|
|
||||||
} while( (timeout < DS_CLIENT_SERVICE_TIMEOUT_TOTAL) &&
|
|
||||||
no_signal &&
|
|
||||||
(ret != QMI_NO_ERR) );
|
|
||||||
}
|
|
||||||
|
|
||||||
//Handle failure cases
|
|
||||||
if(num_services == 0 || ret != QMI_NO_ERR) {
|
|
||||||
if(!no_signal) {
|
|
||||||
LOC_LOGE("%s:%d]: qmi_client_get_service_list failed even though"
|
|
||||||
"service is up! Error: %d \n", __func__, __LINE__, ret);
|
|
||||||
status = E_DS_CLIENT_FAILURE_INTERNAL;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
LOC_LOGE("%s:%d]: qmi_client_get_service_list failed after retries"
|
|
||||||
"Error: %d \n", __func__, __LINE__, ret);
|
|
||||||
status = E_DS_CLIENT_FAILURE_TIMEOUT;
|
|
||||||
}
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
|
|
||||||
LOC_LOGD("%s:%d]: qmi_client_get_service_list succeeded\n", __func__, __LINE__);
|
|
||||||
|
|
||||||
//Success
|
|
||||||
p_service_info = (qmi_service_info *)malloc(num_services * sizeof(qmi_service_info));
|
|
||||||
if(p_service_info == NULL) {
|
|
||||||
LOC_LOGE("%s:%d]: could not allocate memory for serviceInfo !!\n",
|
|
||||||
__func__, __LINE__);
|
|
||||||
status = E_DS_CLIENT_FAILURE_INTERNAL;
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
num_entries = num_services;
|
|
||||||
|
|
||||||
//Populate service info
|
|
||||||
ret = qmi_client_get_service_list(ds_client_service_object, p_service_info,
|
|
||||||
&num_entries, &num_services);
|
|
||||||
if(ret != QMI_NO_ERR) {
|
|
||||||
LOC_LOGE("%s:%d]: qmi_client_get_service_list failed. ret: %d \n",
|
|
||||||
__func__, __LINE__, ret);
|
|
||||||
status = E_DS_CLIENT_FAILURE_INTERNAL;
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Initialize wds_qmi_client
|
|
||||||
LOC_LOGD("%s:%d]: Initializing WDS client with qmi_client_init\n", __func__,
|
|
||||||
__LINE__);
|
|
||||||
ret = qmi_client_init(&p_service_info[0], ds_client_service_object,
|
|
||||||
NULL, NULL, NULL, &wds_qmi_client);
|
|
||||||
if(ret != QMI_NO_ERR) {
|
|
||||||
LOC_LOGE("%s:%d]: qmi_client_init Error. ret: %d\n", __func__, __LINE__, ret);
|
|
||||||
status = E_DS_CLIENT_FAILURE_INTERNAL;
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
LOC_LOGD("%s:%d]: WDS client initialized with qmi_client_init\n", __func__,
|
|
||||||
__LINE__);
|
|
||||||
|
|
||||||
//Store WDS QMI client handle in the parameter passed in
|
|
||||||
*p_wds_qmi_client = wds_qmi_client;
|
|
||||||
|
|
||||||
status = E_DS_CLIENT_SUCCESS;
|
|
||||||
LOC_LOGD("%s:%d]: init success\n", __func__, __LINE__);
|
|
||||||
|
|
||||||
if(notifier)
|
|
||||||
qmi_client_release(notifier);
|
|
||||||
|
|
||||||
err:
|
|
||||||
if(p_service_info)
|
|
||||||
free(p_service_info);
|
|
||||||
|
|
||||||
LOC_LOGD("%s:%d]:Exit\n", __func__, __LINE__);
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*This function reads the error code from within the response struct*/
|
|
||||||
static ds_client_status_enum_type ds_client_convert_qmi_response(
|
|
||||||
uint32_t req_id,
|
|
||||||
ds_client_resp_union_type *resp_union)
|
|
||||||
{
|
|
||||||
ds_client_status_enum_type ret = E_DS_CLIENT_FAILURE_GENERAL;
|
|
||||||
LOC_LOGD("%s:%d]:Enter\n", __func__, __LINE__);
|
|
||||||
switch(req_id)
|
|
||||||
{
|
|
||||||
case QMI_WDS_GET_PROFILE_LIST_REQ_V01 :
|
|
||||||
{
|
|
||||||
if(resp_union->p_get_profile_list_resp->resp.error !=
|
|
||||||
QMI_ERR_NONE_V01) {
|
|
||||||
LOC_LOGE("%s:%d]: Response error: %d", __func__, __LINE__,
|
|
||||||
resp_union->p_get_profile_list_resp->resp.error);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
ret = E_DS_CLIENT_SUCCESS;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case QMI_WDS_GET_PROFILE_SETTINGS_REQ_V01 :
|
|
||||||
{
|
|
||||||
if(resp_union->p_get_profile_setting_resp->resp.error !=
|
|
||||||
QMI_ERR_NONE_V01) {
|
|
||||||
LOC_LOGE("%s:%d]: Response error: %d", __func__, __LINE__,
|
|
||||||
resp_union->p_get_profile_setting_resp->resp.error);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
ret = E_DS_CLIENT_SUCCESS;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
LOC_LOGE("%s:%d]: Unknown request ID\n", __func__, __LINE__);
|
|
||||||
}
|
|
||||||
LOC_LOGD("%s:%d]:Exit\n", __func__, __LINE__);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static ds_client_status_enum_type ds_client_send_qmi_sync_req(
|
|
||||||
qmi_client_type *ds_client_handle,
|
|
||||||
uint32_t req_id,
|
|
||||||
ds_client_resp_union_type *resp_union,
|
|
||||||
ds_client_req_union_type *req_union)
|
|
||||||
{
|
|
||||||
uint32_t req_len = 0;
|
|
||||||
uint32_t resp_len = 0;
|
|
||||||
ds_client_status_enum_type ret = E_DS_CLIENT_SUCCESS;
|
|
||||||
qmi_client_error_type qmi_ret = QMI_NO_ERR;
|
|
||||||
LOC_LOGD("%s:%d]:Enter\n", __func__, __LINE__);
|
|
||||||
switch(req_id)
|
|
||||||
{
|
|
||||||
case QMI_WDS_GET_PROFILE_LIST_REQ_V01 :
|
|
||||||
{
|
|
||||||
req_len = sizeof(wds_get_profile_list_req_msg_v01);
|
|
||||||
resp_len = sizeof(wds_get_profile_list_resp_msg_v01);
|
|
||||||
LOC_LOGD("%s:%d]: req_id = GET_PROFILE_LIST_REQ\n",
|
|
||||||
__func__, __LINE__);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case QMI_WDS_GET_PROFILE_SETTINGS_REQ_V01 :
|
|
||||||
{
|
|
||||||
req_len = sizeof(wds_get_profile_settings_req_msg_v01);
|
|
||||||
resp_len = sizeof(wds_get_profile_settings_resp_msg_v01);
|
|
||||||
LOC_LOGD("%s:%d]: req_id = GET_PROFILE_SETTINGS_REQ\n",
|
|
||||||
__func__, __LINE__);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
LOC_LOGE("%s:%d]: Error unknown req_id=%d\n", __func__, __LINE__,
|
|
||||||
req_id);
|
|
||||||
ret = E_DS_CLIENT_FAILURE_INVALID_PARAMETER;
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
|
|
||||||
LOC_LOGD("%s:%d]: req_id=%d, len = %d; resp_len= %d\n", __func__, __LINE__,
|
|
||||||
req_id, req_len, resp_len);
|
|
||||||
//Send msg through QCCI
|
|
||||||
qmi_ret = qmi_client_send_msg_sync(
|
|
||||||
*ds_client_handle,
|
|
||||||
req_id,
|
|
||||||
(void *)req_union->p_get_profile_list_req,
|
|
||||||
req_len,
|
|
||||||
(void *)resp_union->p_get_profile_list_resp,
|
|
||||||
resp_len,
|
|
||||||
DS_CLIENT_SYNC_MSG_TIMEOUT);
|
|
||||||
LOC_LOGD("%s:%d]: qmi_client_send_msg_sync returned: %d", __func__, __LINE__, qmi_ret);
|
|
||||||
|
|
||||||
if(qmi_ret != QMI_NO_ERR) {
|
|
||||||
ret = E_DS_CLIENT_FAILURE_INTERNAL;
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = ds_client_convert_qmi_response(req_id, resp_union);
|
|
||||||
|
|
||||||
err:
|
|
||||||
LOC_LOGD("%s:%d]:Exit\n", __func__, __LINE__);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*This function obtains the list of supported profiles*/
|
|
||||||
static ds_client_status_enum_type ds_client_get_profile_list(
|
|
||||||
qmi_client_type *ds_client_handle,
|
|
||||||
ds_client_resp_union_type *profile_list_resp_msg,
|
|
||||||
wds_profile_type_enum_v01 profile_type)
|
|
||||||
{
|
|
||||||
ds_client_status_enum_type ret = E_DS_CLIENT_SUCCESS;
|
|
||||||
ds_client_req_union_type req_union;
|
|
||||||
LOC_LOGD("%s:%d]:Enter\n", __func__, __LINE__);
|
|
||||||
|
|
||||||
req_union.p_get_profile_list_req = NULL;
|
|
||||||
req_union.p_get_profile_list_req = (wds_get_profile_list_req_msg_v01 *)
|
|
||||||
calloc(1, sizeof(wds_get_profile_list_req_msg_v01));
|
|
||||||
if(req_union.p_get_profile_list_req == NULL) {
|
|
||||||
LOC_LOGE("%s:%d]: Could not allocate memory for"
|
|
||||||
"wds_get_profile_list_req_msg_v01\n", __func__, __LINE__);
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
//Populate required members of the request structure
|
|
||||||
req_union.p_get_profile_list_req->profile_type_valid = 1;
|
|
||||||
req_union.p_get_profile_list_req->profile_type = profile_type;
|
|
||||||
ret = ds_client_send_qmi_sync_req(ds_client_handle,
|
|
||||||
QMI_WDS_GET_PROFILE_LIST_REQ_V01,
|
|
||||||
profile_list_resp_msg, &req_union);
|
|
||||||
if(ret != E_DS_CLIENT_SUCCESS) {
|
|
||||||
LOC_LOGE("%s:%d]: ds_client_send_qmi_req failed. ret: %d\n",
|
|
||||||
__func__, __LINE__, ret);
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
err:
|
|
||||||
LOC_LOGD("%s:%d]:Exit\n", __func__, __LINE__);
|
|
||||||
if(req_union.p_get_profile_list_req)
|
|
||||||
free(req_union.p_get_profile_list_req);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*This function obtains settings for the profile specified by
|
|
||||||
the profile_identifier*/
|
|
||||||
static ds_client_status_enum_type ds_client_get_profile_settings(
|
|
||||||
qmi_client_type *ds_client_handle,
|
|
||||||
ds_client_resp_union_type *profile_settings_resp_msg,
|
|
||||||
wds_profile_identifier_type_v01 *profile_identifier)
|
|
||||||
{
|
|
||||||
ds_client_status_enum_type ret = E_DS_CLIENT_SUCCESS;
|
|
||||||
ds_client_req_union_type req_union;
|
|
||||||
|
|
||||||
LOC_LOGD("%s:%d]:Enter\n", __func__, __LINE__);
|
|
||||||
//Since it's a union containing a pointer to a structure,
|
|
||||||
//following entities have the same address
|
|
||||||
//- req_union
|
|
||||||
//- req_union.p_get_profile_settings_req
|
|
||||||
//- req_union.p_get_profile_settings_req->profile
|
|
||||||
//so we can very well assign req_union = profile_identifier
|
|
||||||
req_union.p_get_profile_settings_req =
|
|
||||||
(wds_get_profile_settings_req_msg_v01 *)profile_identifier;
|
|
||||||
ret = ds_client_send_qmi_sync_req(ds_client_handle,
|
|
||||||
QMI_WDS_GET_PROFILE_SETTINGS_REQ_V01,
|
|
||||||
profile_settings_resp_msg, &req_union);
|
|
||||||
if(ret != E_DS_CLIENT_SUCCESS) {
|
|
||||||
LOC_LOGE("%s:%d]: ds_client_send_qmi_req failed. ret: %d\n",
|
|
||||||
__func__, __LINE__, ret);
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
err:
|
|
||||||
LOC_LOGD("%s:%d]:Exit\n", __func__, __LINE__);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
Starts data call using the handle and the profile index
|
|
||||||
*/
|
|
||||||
ds_client_status_enum_type
|
|
||||||
ds_client_start_call(dsClientHandleType client_handle, int profile_index)
|
|
||||||
{
|
|
||||||
ds_client_status_enum_type ret = E_DS_CLIENT_FAILURE_GENERAL;
|
|
||||||
dsi_call_param_value_t param_info;
|
|
||||||
dsi_hndl_t dsi_handle;
|
|
||||||
ds_client_session_data *ds_global_data = (ds_client_session_data *)client_handle;
|
|
||||||
LOC_LOGD("%s:%d]:Enter\n", __func__, __LINE__);
|
|
||||||
if(ds_global_data == NULL) {
|
|
||||||
LOC_LOGE("%s:%d]: Null callback parameter\n", __func__, __LINE__);
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
dsi_handle = ds_global_data->dsi_net_handle;
|
|
||||||
//Set profile index as call parameter
|
|
||||||
param_info.buf_val = NULL;
|
|
||||||
param_info.num_val = profile_index;
|
|
||||||
dsi_set_data_call_param(dsi_handle,
|
|
||||||
DSI_CALL_INFO_UMTS_PROFILE_IDX,
|
|
||||||
¶m_info);
|
|
||||||
LOC_LOGD("%s:%d]: Starting emergency call with profile index %d\n",
|
|
||||||
__func__, __LINE__, param_info.num_val);
|
|
||||||
if(dsi_start_data_call(dsi_handle) == DSI_SUCCESS) {
|
|
||||||
LOC_LOGD("%s:%d]: Sent request to start data call\n",
|
|
||||||
__func__, __LINE__);
|
|
||||||
ret = E_DS_CLIENT_SUCCESS;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
LOC_LOGE("%s:%d]: Could not send req to start data call \n", __func__, __LINE__);
|
|
||||||
ret = E_DS_CLIENT_FAILURE_GENERAL;
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
|
|
||||||
err:
|
|
||||||
LOC_LOGD("%s:%d]:Exit\n", __func__, __LINE__);
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/*Function to open an emergency call. Does the following things:
|
|
||||||
- Obtains a handle to the WDS service
|
|
||||||
- Obtains a list of profiles configured in the modem
|
|
||||||
- Queries each profile and obtains settings to check if emergency calls
|
|
||||||
are supported
|
|
||||||
- Returns the profile index that supports emergency calls
|
|
||||||
- Returns handle to dsi_netctrl*/
|
|
||||||
ds_client_status_enum_type
|
|
||||||
ds_client_open_call(dsClientHandleType *client_handle,
|
|
||||||
ds_client_cb_data *callback,
|
|
||||||
void *caller_cookie,
|
|
||||||
int *profile_index)
|
|
||||||
{
|
|
||||||
ds_client_status_enum_type ret = E_DS_CLIENT_FAILURE_GENERAL;
|
|
||||||
ds_client_resp_union_type profile_list_resp_msg;
|
|
||||||
ds_client_resp_union_type profile_settings_resp_msg;
|
|
||||||
wds_profile_identifier_type_v01 profile_identifier;
|
|
||||||
uint32_t i=0;
|
|
||||||
dsi_hndl_t dsi_handle;
|
|
||||||
ds_client_session_data **ds_global_data = (ds_client_session_data **)client_handle;
|
|
||||||
unsigned char call_profile_index_found = 0;
|
|
||||||
uint32_t emergency_profile_index=0;
|
|
||||||
qmi_client_type wds_qmi_client;
|
|
||||||
|
|
||||||
profile_list_resp_msg.p_get_profile_list_resp = NULL;
|
|
||||||
profile_settings_resp_msg.p_get_profile_setting_resp = NULL;
|
|
||||||
|
|
||||||
LOC_LOGD("%s:%d]:Enter\n", __func__, __LINE__);
|
|
||||||
if(callback == NULL || ds_global_data == NULL) {
|
|
||||||
LOC_LOGE("%s:%d]: Null callback parameter\n", __func__, __LINE__);
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = ds_client_qmi_ctrl_point_init(&wds_qmi_client);
|
|
||||||
if(ret != E_DS_CLIENT_SUCCESS) {
|
|
||||||
LOC_LOGE("%s:%d]: ds_client_qmi_ctrl_point_init failed. ret: %d\n",
|
|
||||||
__func__, __LINE__, ret);
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Allocate memory for the response msg to obtain a list of profiles
|
|
||||||
profile_list_resp_msg.p_get_profile_list_resp = (wds_get_profile_list_resp_msg_v01 *)
|
|
||||||
calloc(1, sizeof(wds_get_profile_list_resp_msg_v01));
|
|
||||||
if(profile_list_resp_msg.p_get_profile_list_resp == NULL) {
|
|
||||||
LOC_LOGE("%s:%d]: Could not allocate memory for"
|
|
||||||
"p_get_profile_list_resp\n", __func__, __LINE__);
|
|
||||||
ret = E_DS_CLIENT_FAILURE_NOT_ENOUGH_MEMORY;
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
|
|
||||||
LOC_LOGD("%s:%d]: Getting profile list\n", __func__, __LINE__);
|
|
||||||
ret = ds_client_get_profile_list(&wds_qmi_client,
|
|
||||||
&profile_list_resp_msg,
|
|
||||||
WDS_PROFILE_TYPE_3GPP_V01);
|
|
||||||
if(ret != E_DS_CLIENT_SUCCESS) {
|
|
||||||
LOC_LOGE("%s:%d]: ds_client_get_profile_list failed. ret: %d\n",
|
|
||||||
__func__, __LINE__, ret);
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
LOC_LOGD("%s:%d]: Got profile list; length = %d\n", __func__, __LINE__,
|
|
||||||
profile_list_resp_msg.p_get_profile_list_resp->profile_list_len);
|
|
||||||
|
|
||||||
//Allocate memory for the response msg to obtain profile settings
|
|
||||||
//We allocate memory for only one response msg and keep re-using it
|
|
||||||
profile_settings_resp_msg.p_get_profile_setting_resp =
|
|
||||||
(wds_get_profile_settings_resp_msg_v01 *)
|
|
||||||
calloc(1, sizeof(wds_get_profile_settings_resp_msg_v01));
|
|
||||||
if(profile_settings_resp_msg.p_get_profile_setting_resp == NULL) {
|
|
||||||
LOC_LOGE("%s:%d]: Could not allocate memory for"
|
|
||||||
"p_get_profile_setting_resp\n", __func__, __LINE__);
|
|
||||||
ret = E_DS_CLIENT_FAILURE_NOT_ENOUGH_MEMORY;
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Loop over the list of profiles to find a profile that supports
|
|
||||||
//emergency calls
|
|
||||||
for(i=0; i < profile_list_resp_msg.p_get_profile_list_resp->profile_list_len; i++) {
|
|
||||||
/*QMI_WDS_GET_PROFILE_SETTINGS_REQ requires an input data
|
|
||||||
structure that is of type wds_profile_identifier_type_v01
|
|
||||||
We have to fill that structure for each profile from the
|
|
||||||
info obtained from the profile list*/
|
|
||||||
//copy profile type
|
|
||||||
profile_identifier.profile_type =
|
|
||||||
profile_list_resp_msg.p_get_profile_list_resp->profile_list[i].profile_type;
|
|
||||||
//copy profile index
|
|
||||||
profile_identifier.profile_index =
|
|
||||||
profile_list_resp_msg.p_get_profile_list_resp->profile_list[i].profile_index;
|
|
||||||
|
|
||||||
ret = ds_client_get_profile_settings(&wds_qmi_client,
|
|
||||||
&profile_settings_resp_msg,
|
|
||||||
&profile_identifier);
|
|
||||||
if(ret != E_DS_CLIENT_SUCCESS) {
|
|
||||||
LOC_LOGE("%s:%d]: ds_client_get_profile_settings failed. ret: %d\n",
|
|
||||||
__func__, __LINE__, ret);
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
LOC_LOGD("%s:%d]: Got profile setting for profile %d\n", __func__, __LINE__, i);
|
|
||||||
LOC_LOGD("%s:%d]: Profile name: %s\n", __func__, __LINE__,
|
|
||||||
profile_settings_resp_msg.p_get_profile_setting_resp->profile_name);
|
|
||||||
|
|
||||||
if(profile_settings_resp_msg.p_get_profile_setting_resp->support_emergency_calls_valid) {
|
|
||||||
if(profile_settings_resp_msg.p_get_profile_setting_resp->support_emergency_calls) {
|
|
||||||
LOC_LOGD("%s:%d]: Found emergency profile in profile %d"
|
|
||||||
, __func__, __LINE__, i);
|
|
||||||
call_profile_index_found = 1;
|
|
||||||
emergency_profile_index = profile_identifier.profile_index;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
LOC_LOGE("%s:%d]: Emergency profile valid but not supported in profile: %d "
|
|
||||||
, __func__, __LINE__, i);
|
|
||||||
}
|
|
||||||
//Since this struct is loaded with settings for the next profile,
|
|
||||||
//it is important to clear out the memory to avoid values/flags
|
|
||||||
//from being carried over
|
|
||||||
memset((void *)profile_settings_resp_msg.p_get_profile_setting_resp,
|
|
||||||
0, sizeof(wds_get_profile_settings_resp_msg_v01));
|
|
||||||
}
|
|
||||||
|
|
||||||
//Release qmi client handle
|
|
||||||
if(qmi_client_release(wds_qmi_client) != QMI_NO_ERR) {
|
|
||||||
LOC_LOGE("%s:%d]: Could not release qmi client handle\n",
|
|
||||||
__func__, __LINE__);
|
|
||||||
ret = E_DS_CLIENT_FAILURE_GENERAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(call_profile_index_found) {
|
|
||||||
*profile_index = emergency_profile_index;
|
|
||||||
*ds_global_data = (ds_client_session_data *)calloc(1, sizeof(ds_client_session_data));
|
|
||||||
if(*ds_global_data == NULL) {
|
|
||||||
LOC_LOGE("%s:%d]: Could not allocate memory for ds_global_data. Failing\n",
|
|
||||||
__func__, __LINE__);
|
|
||||||
ret = E_DS_CLIENT_FAILURE_NOT_ENOUGH_MEMORY;
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
|
|
||||||
(*ds_global_data)->caller_data.event_cb = callback->event_cb;
|
|
||||||
(*ds_global_data)->caller_data.caller_cookie = caller_cookie;
|
|
||||||
dsi_handle = dsi_get_data_srvc_hndl(net_ev_cb, &(*ds_global_data)->caller_data);
|
|
||||||
if(dsi_handle == NULL) {
|
|
||||||
LOC_LOGE("%s:%d]: Could not get data handle. Retry Later\n",
|
|
||||||
__func__, __LINE__);
|
|
||||||
ret = E_DS_CLIENT_RETRY_LATER;
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
(*ds_global_data)->dsi_net_handle = dsi_handle;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
LOC_LOGE("%s:%d]: Could not find a profile that supports emergency calls",
|
|
||||||
__func__, __LINE__);
|
|
||||||
ret = E_DS_CLIENT_FAILURE_GENERAL;
|
|
||||||
}
|
|
||||||
err:
|
|
||||||
if(profile_list_resp_msg.p_get_profile_list_resp)
|
|
||||||
free(profile_list_resp_msg.p_get_profile_list_resp);
|
|
||||||
if(profile_settings_resp_msg.p_get_profile_setting_resp)
|
|
||||||
free(profile_settings_resp_msg.p_get_profile_setting_resp);
|
|
||||||
LOC_LOGD("%s:%d]:Exit\n", __func__, __LINE__);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
ds_client_status_enum_type ds_client_stop_call(dsClientHandleType client_handle)
|
|
||||||
{
|
|
||||||
ds_client_status_enum_type ret = E_DS_CLIENT_SUCCESS;
|
|
||||||
ds_client_session_data *p_ds_global_data = (ds_client_session_data *)client_handle;
|
|
||||||
LOC_LOGD("%s:%d]:Enter\n", __func__, __LINE__);
|
|
||||||
|
|
||||||
if(client_handle == NULL) {
|
|
||||||
LOC_LOGE("%s:%d]: Null argument received. Failing\n", __func__, __LINE__);
|
|
||||||
ret = E_DS_CLIENT_FAILURE_GENERAL;
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(dsi_stop_data_call(p_ds_global_data->dsi_net_handle) == DSI_SUCCESS) {
|
|
||||||
LOC_LOGD("%s:%d]: Sent request to stop data call\n", __func__, __LINE__);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
LOC_LOGE("%s:%d]: Could not send request to stop data call\n",
|
|
||||||
__func__, __LINE__);
|
|
||||||
ret = E_DS_CLIENT_FAILURE_GENERAL;
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
|
|
||||||
err:
|
|
||||||
LOC_LOGD("%s:%d]:Exit\n", __func__, __LINE__);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
Stops data call associated with the data handle
|
|
||||||
*/
|
|
||||||
void ds_client_close_call(dsClientHandleType *client_handle)
|
|
||||||
{
|
|
||||||
ds_client_session_data **ds_global_data = (ds_client_session_data **)client_handle;
|
|
||||||
LOC_LOGD("%s:%d]:Enter\n", __func__, __LINE__);
|
|
||||||
if(client_handle == NULL || *client_handle == NULL) {
|
|
||||||
LOC_LOGE("%s:%d]: Null argument received. Failing\n", __func__, __LINE__);
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
dsi_rel_data_srvc_hndl((*ds_global_data)->dsi_net_handle);
|
|
||||||
(*ds_global_data)->dsi_net_handle = NULL;
|
|
||||||
free(*ds_global_data);
|
|
||||||
*ds_global_data = NULL;
|
|
||||||
LOC_LOGD("%s:%d]: Released Data handle\n", __func__, __LINE__);
|
|
||||||
err:
|
|
||||||
LOC_LOGD("%s:%d]:Exit\n", __func__, __LINE__);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
int ds_client_init()
|
|
||||||
{
|
|
||||||
int ret = 0;
|
|
||||||
LOC_LOGD("%s:%d]:Enter\n", __func__, __LINE__);
|
|
||||||
if(DSI_SUCCESS != dsi_init(DSI_MODE_GENERAL))
|
|
||||||
{
|
|
||||||
LOC_LOGE("%s:%d]:dsi_init failed\n", __func__, __LINE__);
|
|
||||||
ret = -1;
|
|
||||||
}
|
|
||||||
LOC_LOGD("%s:%d]:Exit\n", __func__, __LINE__);
|
|
||||||
return ret;
|
|
||||||
}
|
|
|
@ -1,142 +0,0 @@
|
||||||
/* Copyright (c) 2013, The Linux Foundation. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions are
|
|
||||||
* met:
|
|
||||||
* * Redistributions of source code must retain the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer.
|
|
||||||
* * Redistributions in binary form must reproduce the above
|
|
||||||
* copyright notice, this list of conditions and the following
|
|
||||||
* disclaimer in the documentation and/or other materials provided
|
|
||||||
* with the distribution.
|
|
||||||
* * Neither the name of The Linux Foundation, nor the names of its
|
|
||||||
* contributors may be used to endorse or promote products derived
|
|
||||||
* from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
|
||||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
|
||||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
||||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
||||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
|
||||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
|
||||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
|
||||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _DS_CLIENT_H_
|
|
||||||
#define _DS_CLIENT_H_
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef void* dsClientHandleType;
|
|
||||||
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
E_DS_CLIENT_SUCCESS = 0,
|
|
||||||
/**< Request was successful. */
|
|
||||||
|
|
||||||
E_DS_CLIENT_FAILURE_GENERAL = 1,
|
|
||||||
/**< Failed because of a general failure. */
|
|
||||||
|
|
||||||
E_DS_CLIENT_FAILURE_UNSUPPORTED = 2,
|
|
||||||
/**< Failed because the service does not support the command. */
|
|
||||||
|
|
||||||
E_DS_CLIENT_FAILURE_INVALID_PARAMETER = 3,
|
|
||||||
/**< Failed because the request contained invalid parameters. */
|
|
||||||
|
|
||||||
E_DS_CLIENT_FAILURE_ENGINE_BUSY = 4,
|
|
||||||
/**< Failed because the engine is busy. */
|
|
||||||
|
|
||||||
E_DS_CLIENT_FAILURE_PHONE_OFFLINE = 5,
|
|
||||||
/**< Failed because the phone is offline. */
|
|
||||||
|
|
||||||
E_DS_CLIENT_FAILURE_TIMEOUT = 6,
|
|
||||||
/**< Failed because of a timeout. */
|
|
||||||
|
|
||||||
E_DS_CLIENT_FAILURE_SERVICE_NOT_PRESENT = 7,
|
|
||||||
/**< Failed because the service is not present. */
|
|
||||||
|
|
||||||
E_DS_CLIENT_FAILURE_SERVICE_VERSION_UNSUPPORTED = 8,
|
|
||||||
/**< Failed because the service version is unsupported. */
|
|
||||||
|
|
||||||
E_DS_CLIENT_FAILURE_CLIENT_VERSION_UNSUPPORTED = 9,
|
|
||||||
/**< Failed because the service does not support client version. */
|
|
||||||
|
|
||||||
E_DS_CLIENT_FAILURE_INVALID_HANDLE = 10,
|
|
||||||
/**< Failed because an invalid handle was specified. */
|
|
||||||
|
|
||||||
E_DS_CLIENT_FAILURE_INTERNAL = 11,
|
|
||||||
/**< Failed because of an internal error in the service. */
|
|
||||||
|
|
||||||
E_DS_CLIENT_FAILURE_NOT_INITIALIZED = 12,
|
|
||||||
/**< Failed because the service has not been initialized. */
|
|
||||||
|
|
||||||
E_DS_CLIENT_FAILURE_NOT_ENOUGH_MEMORY = 13,
|
|
||||||
/**< Failed because not rnough memory to do the operation.*/
|
|
||||||
|
|
||||||
E_DS_CLIENT_SERVICE_ALREADY_STARTED = 14,
|
|
||||||
/*Service is already started*/
|
|
||||||
|
|
||||||
E_DS_CLIENT_DATA_CALL_CONNECTED = 15,
|
|
||||||
|
|
||||||
E_DS_CLIENT_DATA_CALL_DISCONNECTED = 16,
|
|
||||||
|
|
||||||
E_DS_CLIENT_RETRY_LATER = 17
|
|
||||||
}ds_client_status_enum_type;
|
|
||||||
|
|
||||||
typedef enum {
|
|
||||||
DATA_CALL_NONE = 0,
|
|
||||||
DATA_CALL_OPEN,
|
|
||||||
DATA_CALL_CLOSE
|
|
||||||
}data_call_request_enum_type;
|
|
||||||
|
|
||||||
typedef void (*ds_client_event_ind_cb_type)(ds_client_status_enum_type result,
|
|
||||||
void* loc_adapter_cookie);
|
|
||||||
typedef struct {
|
|
||||||
ds_client_event_ind_cb_type event_cb;
|
|
||||||
}ds_client_cb_data;
|
|
||||||
|
|
||||||
/*
|
|
||||||
This function is to be called as a first step by each process that
|
|
||||||
needs to use data services. This call internally calls dsi_init()
|
|
||||||
and prepares the module for making data calls.
|
|
||||||
Needs to be called once for every process
|
|
||||||
*/
|
|
||||||
int ds_client_init();
|
|
||||||
|
|
||||||
/*
|
|
||||||
Obtains a handle to the dsi_netctrl layer and looks up the profile
|
|
||||||
to make the call. As of now. It only searches for profiles that
|
|
||||||
support emergency calls
|
|
||||||
*/
|
|
||||||
ds_client_status_enum_type ds_client_open_call(dsClientHandleType *client_handle,
|
|
||||||
ds_client_cb_data *callback,
|
|
||||||
void *loc_adapter_cookie,
|
|
||||||
int *profile_index);
|
|
||||||
|
|
||||||
/*
|
|
||||||
Starts a data call using the profile number provided
|
|
||||||
*/
|
|
||||||
ds_client_status_enum_type ds_client_start_call(dsClientHandleType client_handle,
|
|
||||||
int profile_index);
|
|
||||||
|
|
||||||
/*
|
|
||||||
Stops a data call associated with the handle
|
|
||||||
*/
|
|
||||||
ds_client_status_enum_type ds_client_stop_call(dsClientHandleType client_handle);
|
|
||||||
|
|
||||||
/*
|
|
||||||
Releases the handle used for making data calls
|
|
||||||
*/
|
|
||||||
void ds_client_close_call(dsClientHandleType *client_handle);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -1,52 +0,0 @@
|
||||||
ifneq ($(BUILD_TINY_ANDROID),true)
|
|
||||||
|
|
||||||
LOCAL_PATH := $(call my-dir)
|
|
||||||
|
|
||||||
include $(CLEAR_VARS)
|
|
||||||
|
|
||||||
LOCAL_MODULE := libloc_api_v02
|
|
||||||
|
|
||||||
LOCAL_MODULE_TAGS := optional
|
|
||||||
|
|
||||||
LOCAL_SHARED_LIBRARIES := \
|
|
||||||
libutils \
|
|
||||||
libcutils \
|
|
||||||
libqmi_cci \
|
|
||||||
libqmi_csi \
|
|
||||||
libqmi_common_so \
|
|
||||||
libloc_adapter \
|
|
||||||
libgps.utils \
|
|
||||||
libds_api
|
|
||||||
|
|
||||||
LOCAL_SRC_FILES += \
|
|
||||||
LocApiV02Adapter.cpp \
|
|
||||||
loc_api_v02_log.c \
|
|
||||||
loc_api_v02_client.c \
|
|
||||||
loc_api_sync_req.c \
|
|
||||||
location_service_v02.c
|
|
||||||
|
|
||||||
LOCAL_CFLAGS += \
|
|
||||||
-fno-short-enums \
|
|
||||||
-D_ANDROID_
|
|
||||||
|
|
||||||
ifeq ($(FEATURE_IPV6), true)
|
|
||||||
LOCAL_CFLAGS += -DFEATURE_IPV6
|
|
||||||
endif #FEATURE_IPV6
|
|
||||||
|
|
||||||
ifeq ($(FEATURE_DELEXT), true)
|
|
||||||
LOCAL_CFLAGS += -DFEATURE_DELEXT
|
|
||||||
endif #FEATURE_DELEXT
|
|
||||||
|
|
||||||
## Includes
|
|
||||||
LOCAL_C_INCLUDES := \
|
|
||||||
$(TARGET_OUT_HEADERS)/libloc_eng \
|
|
||||||
$(TARGET_OUT_HEADERS)/qmi-framework/inc \
|
|
||||||
$(TARGET_OUT_HEADERS)/qmi/inc \
|
|
||||||
$(TARGET_OUT_HEADERS)/gps.utils \
|
|
||||||
$(TARGET_OUT_HEADERS)/ds_api
|
|
||||||
|
|
||||||
LOCAL_PRELINK_MODULE := false
|
|
||||||
|
|
||||||
include $(BUILD_SHARED_LIBRARY)
|
|
||||||
|
|
||||||
endif # not BUILD_TINY_ANDROID
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,182 +0,0 @@
|
||||||
/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions are
|
|
||||||
* met:
|
|
||||||
* * Redistributions of source code must retain the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer.
|
|
||||||
* * Redistributions in binary form must reproduce the above
|
|
||||||
* copyright notice, this list of conditions and the following
|
|
||||||
* disclaimer in the documentation and/or other materials provided
|
|
||||||
* with the distribution.
|
|
||||||
* * Neither the name of The Linux Foundation, nor the names of its
|
|
||||||
* contributors may be used to endorse or promote products derived
|
|
||||||
* from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
|
||||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
|
||||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
||||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
||||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
|
||||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
|
||||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
|
||||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef LOC_API_V_0_2_ADAPTER_H
|
|
||||||
#define LOC_API_V_0_2_ADAPTER_H
|
|
||||||
|
|
||||||
#include <LocApiAdapter.h>
|
|
||||||
#include "loc_api_v02_client.h"
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <stdbool.h>
|
|
||||||
#include "ds_client.h"
|
|
||||||
|
|
||||||
/* This class derives from the LocApiAdapter class.
|
|
||||||
The members of this class are responsible for converting
|
|
||||||
the Loc API V02 data structures into Loc Engine data structures.
|
|
||||||
This class also implements some of the virtual functions that
|
|
||||||
handle the requests from loc engine. */
|
|
||||||
class LocApiV02Adapter : public LocApiAdapter {
|
|
||||||
/*ds client handle*/
|
|
||||||
dsClientHandleType dsClientHandle;
|
|
||||||
|
|
||||||
/* loc api v02 handle*/
|
|
||||||
locClientHandleType clientHandle;
|
|
||||||
|
|
||||||
/* events the client is registered for */
|
|
||||||
locClientEventMaskType eventMask;
|
|
||||||
|
|
||||||
/* Convert event mask from loc eng to loc_api_v02 format */
|
|
||||||
locClientEventMaskType convertMask(LOC_API_ADAPTER_EVENT_MASK_T mask);
|
|
||||||
|
|
||||||
/* Convert error from loc_api_v02 to loc eng format*/
|
|
||||||
enum loc_api_adapter_err convertErr(locClientStatusEnumType status);
|
|
||||||
|
|
||||||
/* convert Ni Encoding type from QMI_LOC to loc eng format */
|
|
||||||
GpsNiEncodingType convertNiEncoding(
|
|
||||||
qmiLocNiDataCodingSchemeEnumT_v02 loc_encoding);
|
|
||||||
|
|
||||||
/*convert NI notify verify type from QMI LOC to loc eng format*/
|
|
||||||
bool convertNiNotifyVerifyType (GpsNiNotification *notif,
|
|
||||||
qmiLocNiNotifyVerifyEnumT_v02 notif_priv);
|
|
||||||
|
|
||||||
/* close Loc API V02 client */
|
|
||||||
int deInitLocClient();
|
|
||||||
|
|
||||||
/* convert position report to loc eng format and send the converted
|
|
||||||
position to loc eng */
|
|
||||||
void reportPosition
|
|
||||||
(const qmiLocEventPositionReportIndMsgT_v02 *location_report_ptr);
|
|
||||||
|
|
||||||
/* convert satellite report to loc eng format and send the converted
|
|
||||||
report to loc eng */
|
|
||||||
void reportSv (const qmiLocEventGnssSvInfoIndMsgT_v02 *gnss_report_ptr);
|
|
||||||
|
|
||||||
/* convert engine state report to loc eng format and send the converted
|
|
||||||
report to loc eng */
|
|
||||||
void reportEngineState (
|
|
||||||
const qmiLocEventEngineStateIndMsgT_v02 *engine_state_ptr);
|
|
||||||
|
|
||||||
/* convert fix session report to loc eng format and send the converted
|
|
||||||
report to loc eng */
|
|
||||||
void reportFixSessionState (
|
|
||||||
const qmiLocEventFixSessionStateIndMsgT_v02 *fix_session_state_ptr);
|
|
||||||
|
|
||||||
/* convert NMEA report to loc eng format and send the converted
|
|
||||||
report to loc eng */
|
|
||||||
void reportNmea (const qmiLocEventNmeaIndMsgT_v02 *nmea_report_ptr);
|
|
||||||
|
|
||||||
/* convert and report an ATL request to loc engine */
|
|
||||||
void reportAtlRequest(
|
|
||||||
const qmiLocEventLocationServerConnectionReqIndMsgT_v02
|
|
||||||
*server_request_ptr);
|
|
||||||
|
|
||||||
/* convert and report NI request to loc eng */
|
|
||||||
void reportNiRequest(
|
|
||||||
const qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *ni_req_ptr);
|
|
||||||
|
|
||||||
public:
|
|
||||||
LocApiV02Adapter(LocEng &locEng);
|
|
||||||
~LocApiV02Adapter();
|
|
||||||
|
|
||||||
/* event callback registered with the loc_api v02 interface */
|
|
||||||
void eventCb(locClientHandleType client_handle,
|
|
||||||
uint32_t loc_event_id,
|
|
||||||
locClientEventIndUnionType loc_event_payload);
|
|
||||||
|
|
||||||
/* error callback, this function handles the service unavailable
|
|
||||||
error */
|
|
||||||
void errorCb(locClientHandleType handle,
|
|
||||||
locClientErrorEnumType errorId);
|
|
||||||
|
|
||||||
void ds_client_event_cb(ds_client_status_enum_type result);
|
|
||||||
int openAndStartDataCall();
|
|
||||||
void stopDataCall();
|
|
||||||
void closeDataCall();
|
|
||||||
int initDataServiceClient();
|
|
||||||
|
|
||||||
virtual enum loc_api_adapter_err reinit();
|
|
||||||
|
|
||||||
virtual enum loc_api_adapter_err startFix();
|
|
||||||
|
|
||||||
virtual enum loc_api_adapter_err stopFix();
|
|
||||||
|
|
||||||
virtual enum loc_api_adapter_err
|
|
||||||
setPositionMode(const LocPosMode *mode);
|
|
||||||
|
|
||||||
virtual enum loc_api_adapter_err
|
|
||||||
setTime(GpsUtcTime time, int64_t timeReference, int uncertainty);
|
|
||||||
|
|
||||||
virtual enum loc_api_adapter_err
|
|
||||||
injectPosition(double latitude, double longitude, float accuracy);
|
|
||||||
|
|
||||||
virtual enum loc_api_adapter_err
|
|
||||||
deleteAidingData(GpsAidingData f);
|
|
||||||
|
|
||||||
virtual enum loc_api_adapter_err
|
|
||||||
informNiResponse(GpsUserResponseType userResponse,
|
|
||||||
const void* passThroughData);
|
|
||||||
|
|
||||||
virtual enum loc_api_adapter_err
|
|
||||||
setServer(const char* url, int len);
|
|
||||||
virtual enum loc_api_adapter_err
|
|
||||||
setServer(unsigned int ip, int port, LocServerType type);
|
|
||||||
virtual enum loc_api_adapter_err
|
|
||||||
setXtraData(char* data, int length);
|
|
||||||
#ifdef FEATURE_IPV6
|
|
||||||
virtual enum loc_api_adapter_err
|
|
||||||
atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bear,
|
|
||||||
AGpsType agpsType);
|
|
||||||
#else
|
|
||||||
virtual enum loc_api_adapter_err
|
|
||||||
atlOpenStatus(int handle, int is_succ, char* apn,
|
|
||||||
AGpsType agpsType);
|
|
||||||
#endif
|
|
||||||
virtual enum loc_api_adapter_err atlCloseStatus(int handle, int is_succ);
|
|
||||||
virtual enum loc_api_adapter_err setSUPLVersion(uint32_t version);
|
|
||||||
virtual enum loc_api_adapter_err setLPPConfig(uint32_t profile);
|
|
||||||
|
|
||||||
virtual enum loc_api_adapter_err
|
|
||||||
setSensorControlConfig(int sensorUsage);
|
|
||||||
|
|
||||||
virtual enum loc_api_adapter_err
|
|
||||||
setSensorProperties(bool gyroBiasVarianceRandomWalk_valid, float gyroBiasVarianceRandomWalk,
|
|
||||||
bool accelBiasVarianceRandomWalk_valid, float accelBiasVarianceRandomWalk,
|
|
||||||
bool angleBiasVarianceRandomWalk_valid, float angleBiasVarianceRandomWalk,
|
|
||||||
bool rateBiasVarianceRandomWalk_valid, float rateBiasVarianceRandomWalk,
|
|
||||||
bool velocityBiasVarianceRandomWalk_valid, float velocityBiasVarianceRandomWalk);
|
|
||||||
|
|
||||||
virtual enum loc_api_adapter_err
|
|
||||||
setSensorPerfControlConfig(int controlMode, int accelSamplesPerBatch, int accelBatchesPerSec,
|
|
||||||
int gyroSamplesPerBatch, int gyroBatchesPerSec,
|
|
||||||
int accelSamplesPerBatchHigh, int accelBatchesPerSecHigh,
|
|
||||||
int gyroSamplesPerBatchHigh, int gyroBatchesPerSecHigh, int algorithmConfig);
|
|
||||||
virtual enum loc_api_adapter_err setExtPowerConfig(int isBatteryCharging);
|
|
||||||
virtual enum loc_api_adapter_err setAGLONASSProtocol(unsigned long aGlonassProtocol);
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif //LOC_API_V_0_2_ADAPTER_H
|
|
|
@ -1,42 +0,0 @@
|
||||||
AM_CFLAGS = \
|
|
||||||
${QMIF_CFLAGS} \
|
|
||||||
-I../../utils \
|
|
||||||
-I../../platform_lib_abstractions \
|
|
||||||
-I../libloc_api_50001
|
|
||||||
|
|
||||||
requiredlibs = \
|
|
||||||
${QMIF_LIBS} \
|
|
||||||
../libloc_api_50001/libloc_adapter_so.la \
|
|
||||||
../../utils/libgps_utils_so.la
|
|
||||||
|
|
||||||
h_sources = LocApiV02Adapter.h \
|
|
||||||
loc_util_log.h \
|
|
||||||
location_service_v02.h \
|
|
||||||
loc_api_sync_req.h \
|
|
||||||
loc_api_v02_client.h \
|
|
||||||
loc_api_v02_log.h
|
|
||||||
|
|
||||||
c_sources = LocApiV02Adapter.cpp \
|
|
||||||
loc_api_v02_log.c \
|
|
||||||
loc_api_v02_client.c \
|
|
||||||
loc_api_sync_req.c \
|
|
||||||
location_service_v02.c
|
|
||||||
|
|
||||||
library_includedir = $(pkgincludedir)
|
|
||||||
library_include_HEADERS = $(h_sources)
|
|
||||||
|
|
||||||
libloc_api_la_SOURCES = $(c_sources) $(h_sources)
|
|
||||||
|
|
||||||
if USE_GLIB
|
|
||||||
libloc_api_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@
|
|
||||||
libloc_api_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0
|
|
||||||
libloc_api_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@
|
|
||||||
else
|
|
||||||
libloc_api_la_CFLAGS = $(AM_CFLAGS)
|
|
||||||
libloc_api_la_LDFLAGS = -shared -version-info 1:0:0
|
|
||||||
libloc_api_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
libloc_api_la_LIBADD = $(requiredlibs) -lstdc++
|
|
||||||
|
|
||||||
lib_LTLIBRARIES = libloc_api.la
|
|
|
@ -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;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,295 +0,0 @@
|
||||||
/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions are
|
|
||||||
* met:
|
|
||||||
* * Redistributions of source code must retain the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer.
|
|
||||||
* * Redistributions in binary form must reproduce the above
|
|
||||||
* copyright notice, this list of conditions and the following
|
|
||||||
* disclaimer in the documentation and/or other materials provided
|
|
||||||
* with the distribution.
|
|
||||||
* * Neither the name of The Linux Foundation, nor the names of its
|
|
||||||
* contributors may be used to endorse or promote products derived
|
|
||||||
* from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
|
||||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
|
||||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
||||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
||||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
|
||||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
|
||||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
|
||||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#include <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),
|
|
||||||
NAME_VAL(QMI_LOC_GET_SUPPORTED_MSGS_REQ_V02),
|
|
||||||
NAME_VAL(QMI_LOC_GET_SUPPORTED_MSGS_RESP_V02),
|
|
||||||
NAME_VAL(QMI_LOC_GET_SUPPORTED_FIELDS_REQ_V02),
|
|
||||||
NAME_VAL(QMI_LOC_GET_SUPPORTED_FIELDS_RESP_V02),
|
|
||||||
};
|
|
||||||
static int loc_v02_event_num = sizeof(loc_v02_event_name) / sizeof(loc_name_val_s_type);
|
|
||||||
|
|
||||||
const char* loc_get_v02_event_name(uint32_t event)
|
|
||||||
{
|
|
||||||
return loc_get_name_from_val(loc_v02_event_name, loc_v02_event_num, (long) event);
|
|
||||||
}
|
|
||||||
|
|
||||||
static loc_name_val_s_type loc_v02_client_status_name[] =
|
|
||||||
{
|
|
||||||
NAME_VAL(eLOC_CLIENT_SUCCESS),
|
|
||||||
NAME_VAL(eLOC_CLIENT_FAILURE_GENERAL),
|
|
||||||
NAME_VAL(eLOC_CLIENT_FAILURE_UNSUPPORTED),
|
|
||||||
NAME_VAL(eLOC_CLIENT_FAILURE_INVALID_PARAMETER),
|
|
||||||
NAME_VAL(eLOC_CLIENT_FAILURE_ENGINE_BUSY),
|
|
||||||
NAME_VAL(eLOC_CLIENT_FAILURE_PHONE_OFFLINE),
|
|
||||||
NAME_VAL(eLOC_CLIENT_FAILURE_TIMEOUT),
|
|
||||||
NAME_VAL(eLOC_CLIENT_FAILURE_SERVICE_NOT_PRESENT),
|
|
||||||
NAME_VAL(eLOC_CLIENT_FAILURE_SERVICE_VERSION_UNSUPPORTED),
|
|
||||||
NAME_VAL(eLOC_CLIENT_FAILURE_CLIENT_VERSION_UNSUPPORTED),
|
|
||||||
NAME_VAL(eLOC_CLIENT_FAILURE_INVALID_HANDLE),
|
|
||||||
NAME_VAL(eLOC_CLIENT_FAILURE_INTERNAL),
|
|
||||||
NAME_VAL(eLOC_CLIENT_FAILURE_NOT_INITIALIZED),
|
|
||||||
NAME_VAL(eLOC_CLIENT_FAILURE_NOT_ENOUGH_MEMORY),
|
|
||||||
};
|
|
||||||
static int loc_v02_client_status_num = sizeof(loc_v02_client_status_name) / sizeof(loc_name_val_s_type);
|
|
||||||
|
|
||||||
const char* loc_get_v02_client_status_name(locClientStatusEnumType status)
|
|
||||||
{
|
|
||||||
return loc_get_name_from_val(loc_v02_client_status_name, loc_v02_client_status_num, (long) status);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static loc_name_val_s_type loc_v02_qmi_status_name[] =
|
|
||||||
{
|
|
||||||
NAME_VAL(eQMI_LOC_SUCCESS_V02),
|
|
||||||
NAME_VAL(eQMI_LOC_GENERAL_FAILURE_V02),
|
|
||||||
NAME_VAL(eQMI_LOC_UNSUPPORTED_V02),
|
|
||||||
NAME_VAL(eQMI_LOC_INVALID_PARAMETER_V02),
|
|
||||||
NAME_VAL(eQMI_LOC_ENGINE_BUSY_V02),
|
|
||||||
NAME_VAL(eQMI_LOC_PHONE_OFFLINE_V02),
|
|
||||||
NAME_VAL(eQMI_LOC_TIMEOUT_V02),
|
|
||||||
NAME_VAL(eQMI_LOC_CONFIG_NOT_SUPPORTED_V02),
|
|
||||||
NAME_VAL(eQMI_LOC_INSUFFICIENT_MEMORY_V02),
|
|
||||||
};
|
|
||||||
static int loc_v02_qmi_status_num = sizeof(loc_v02_qmi_status_name) / sizeof(loc_name_val_s_type);
|
|
||||||
|
|
||||||
const char* loc_get_v02_qmi_status_name(qmiLocStatusEnumT_v02 status)
|
|
||||||
{
|
|
||||||
return loc_get_name_from_val(loc_v02_qmi_status_name, loc_v02_qmi_status_num, (long) status);
|
|
||||||
}
|
|
|
@ -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