本文整理汇总了C++中LOC_LOGE函数的典型用法代码示例。如果您正苦于以下问题:C++ LOC_LOGE函数的具体用法?C++ LOC_LOGE怎么用?C++ LOC_LOGE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LOC_LOGE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: msg_q_unblock
/*===========================================================================
FUNCTION: msg_q_unblock
===========================================================================*/
msq_q_err_type msg_q_unblock(void* msg_q_data)
{
if ( msg_q_data == NULL )
{
LOC_LOGE("%s: Invalid msg_q_data parameter!\n", __FUNCTION__);
return eMSG_Q_INVALID_HANDLE;
}
msg_q* p_msg_q = (msg_q*)msg_q_data;
pthread_mutex_lock(&p_msg_q->list_mutex);
if( p_msg_q->unblocked )
{
LOC_LOGE("%s: Message queue has been unblocked.\n", __FUNCTION__);
pthread_mutex_unlock(&p_msg_q->list_mutex);
return eMSG_Q_UNAVAILABLE_RESOURCE;
}
LOC_LOGD("%s: Unblocking Message Queue\n", __FUNCTION__);
/* Unblocking message queue */
p_msg_q->unblocked = 1;
/* Allow all the waiters to wake up */
pthread_cond_broadcast(&p_msg_q->list_cond);
pthread_mutex_unlock(&p_msg_q->list_mutex);
LOC_LOGD("%s: Message Queue unblocked\n", __FUNCTION__);
return eMSG_Q_SUCCESS;
}
示例2: LOC_LOGD
/**
@brief Register sensor client with SLIM CORE
Function sends message to slim daemon to initiate client
registration with SLIM CORE
@param z_Txn: Parameters for sensor client registration
*/
int SocketClientWrapper::ClientRegister(slim_OpenTxnStructType &z_Txn)
{
LOC_LOGD("%s:%d] Received client register", __func__, __LINE__);
SocketClientOpenReq openRequest;
memset(&openRequest, 0, sizeof(openRequest));
openRequest.msgHeader.msgId = eSLIM_SOCKET_CLIENT_MSG_ID_OPEN_REQ;
openRequest.msgHeader.msgSize = sizeof(SocketClientOpenReq);
openRequest.msgPayload = z_Txn;
LOC_LOGD("%s:%d] sizeof(SocketClientOpenReq) is %d, sizeof(openRequest.msgHeader) is %d",
__func__, __LINE__, sizeof(SocketClientOpenReq), sizeof(openRequest.msgHeader));
SocketClientWrapper::mCallbackFunction = openRequest.msgPayload.fn_Callback;
LOC_LOGD("%s:%d] Received client register, p_Handle is %08X", __func__, __LINE__, z_Txn.p_Handle);
LOC_LOGD("%s:%d] Received fn_Callback is %08X", __func__, __LINE__, openRequest.msgPayload.fn_Callback);
// If socket_not_present or socket_not_connected, then error/warning
if ( (SocketClientWrapper::mSocketFd < 0)
)
{
LOC_LOGE("%s[%d]: socket not present/connected\n",
__func__, __LINE__);
return -1;
}
if (write(SocketClientWrapper::mSocketFd, &openRequest, sizeof(openRequest)) < 0)
{
LOC_LOGE("%s[%d]: error writing on socket\n", __func__, __LINE__);
return -1;
}
return 0;
}
示例3: dlopen
LocApiAdapter* LocApiAdapter::getLocApiAdapter(LocEng &locEng)
{
void* handle;
LocApiAdapter* adapter = NULL;
handle = dlopen ("libloc_api_v02.so", RTLD_NOW);
if (!handle) {
LOC_LOGE("%s: dlopen(libloc_api_v02.so) failed, trying to load libloc_api-rpc-qc.so", __FUNCTION__);
LOC_LOGE("%s: %s", __FUNCTION__, dlerror());
handle = dlopen ("libloc_api-rpc-qc.so", RTLD_NOW);
}
else
LOC_LOGI("%s: dlopen(libloc_api_v02.so) succeeded.", __FUNCTION__);
if (!handle) {
LOC_LOGE("%s: dlopen(libloc_api-rpc-qc.so) failed, constructing LocApiAdapter", __FUNCTION__);
adapter = new LocApiAdapter(locEng);
} else {
getLocApiAdapter_t* getHandle = (getLocApiAdapter_t*)dlsym(handle, "_Z16getLocApiAdapterR6LocEng");
if (!getHandle) {
LOC_LOGE("%s: dlsym(getLocApiAdapter) failed", __FUNCTION__);
LOC_LOGE("%s: %s", __FUNCTION__, dlerror());
return NULL;
}
adapter = (*getHandle)(locEng);
}
return adapter;
}
示例4: ds_client_stop_call
/**
* @brief Stops a data call associated with the handle
*
* @param[in] client_handle Client handle
*
* @return Operation result
* @retval E_DS_CLIENT_SUCCESS On success.
* @retval E_DS_CLIENT_FAILURE... On error.
*/
static 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;
}
示例5: loc_eng_dmn_conn_glue_pipeget
/*===========================================================================
FUNCTION loc_eng_dmn_conn_glue_pipeget
DESCRIPTION
create a named pipe.
pipe_name - pipe name path
mode - mode
DEPENDENCIES
None
RETURN VALUE
0: success or negative value for failure
SIDE EFFECTS
N/A
===========================================================================*/
int loc_eng_dmn_conn_glue_pipeget(const char * pipe_name, int mode)
{
int fd;
int result;
LOC_LOGD("%s, mode = %d\n", pipe_name, mode);
result = mkfifo(pipe_name, 0660);
if ((result == -1) && (errno != EEXIST)) {
LOC_LOGE("failed: %s\n", strerror(errno));
return result;
}
// The mode in mkfifo is not honoured and does not provide the
// group permissions. Doing chmod to add group permissions.
result = chmod (pipe_name, 0660);
if (result != 0){
LOC_LOGE ("%s failed to change mode for %s, error = %s\n", __func__,
pipe_name, strerror(errno));
}
fd = open(pipe_name, mode);
if (fd <= 0)
{
LOC_LOGE("failed: %s\n", strerror(errno));
}
LOC_LOGD("fd = %d, %s\n", fd, pipe_name);
return fd;
}
示例6: get_geofence_interface
const GpsGeofencingInterface* get_geofence_interface(void)
{
ENTRY_LOG();
void *handle;
const char *error;
typedef const GpsGeofencingInterface* (*get_gps_geofence_interface_function) (void);
get_gps_geofence_interface_function get_gps_geofence_interface;
static const GpsGeofencingInterface* geofence_interface = NULL;
dlerror(); /* Clear any existing error */
handle = dlopen ("libgeofence.so", RTLD_NOW);
if (!handle)
{
if ((error = dlerror()) != NULL) {
LOC_LOGE ("%s, dlopen for libgeofence.so failed, error = %s\n", __func__, error);
}
goto exit;
}
dlerror(); /* Clear any existing error */
get_gps_geofence_interface = (get_gps_geofence_interface_function)dlsym(handle, "gps_geofence_get_interface");
if ((error = dlerror()) != NULL) {
LOC_LOGE ("%s, dlsym for ulpInterface failed, error = %s\n", __func__, error);
goto exit;
}
geofence_interface = get_gps_geofence_interface();
exit:
EXIT_LOG(%d, geofence_interface == NULL);
return geofence_interface;
}
示例7: ds_client_get_profile_list
/*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;
}
示例8: loc_set_config_entry
/*===========================================================================
FUNCTION loc_set_config_entry
DESCRIPTION
Potentially sets a given configuration table entry based on the passed in
configuration value. This is done by using a string comparison of the
parameter names and those found in the configuration file.
PARAMETERS:
config_entry: configuration entry in the table to possibly set
config_value: value to store in the entry if the parameter names match
DEPENDENCIES
N/A
RETURN VALUE
None
SIDE EFFECTS
N/A
===========================================================================*/
void loc_set_config_entry(loc_param_s_type* config_entry, loc_param_v_type* config_value)
{
if(NULL == config_entry || NULL == config_value)
{
LOC_LOGE("%s: INVALID config entry or parameter", __FUNCTION__);
return;
}
if (strcmp(config_entry->param_name, config_value->param_name) == 0 &&
config_entry->param_ptr)
{
switch (config_entry->param_type)
{
case 's':
if (strcmp(config_value->param_str_value, "NULL") == 0)
{
*((char*)config_entry->param_ptr) = '\0';
}
else {
strlcpy((char*) config_entry->param_ptr,
config_value->param_str_value,
LOC_MAX_PARAM_STRING + 1);
}
/* Log INI values */
LOC_LOGD("%s: PARAM %s = %s", __FUNCTION__, config_entry->param_name, (char*)config_entry->param_ptr);
if(NULL != config_entry->param_set)
{
*(config_entry->param_set) = 1;
}
break;
case 'n':
*((int *)config_entry->param_ptr) = config_value->param_int_value;
/* Log INI values */
LOC_LOGD("%s: PARAM %s = %d", __FUNCTION__, config_entry->param_name, config_value->param_int_value);
if(NULL != config_entry->param_set)
{
*(config_entry->param_set) = 1;
}
break;
case 'f':
*((double *)config_entry->param_ptr) = config_value->param_double_value;
/* Log INI values */
LOC_LOGD("%s: PARAM %s = %f", __FUNCTION__, config_entry->param_name, config_value->param_double_value);
if(NULL != config_entry->param_set)
{
*(config_entry->param_set) = 1;
}
break;
default:
LOC_LOGE("%s: PARAM %s parameter type must be n, f, or s", __FUNCTION__, config_entry->param_name);
}
}
}
示例9: loc_api_server_proc_init
static int loc_api_server_proc_init(void *context)
{
loc_api_server_msgqid = loc_eng_dmn_conn_glue_msgget(global_loc_api_q_path, O_RDWR);
//change mode/group for the global_loc_api_q_path pipe
int result = chmod (global_loc_api_q_path, 0660);
if (result != 0)
{
LOC_LOGE("failed to change mode for %s, error = %s\n", global_loc_api_q_path, strerror(errno));
}
struct group * gps_group = getgrnam("gps");
if (gps_group != NULL)
{
result = chown (global_loc_api_q_path, -1, gps_group->gr_gid);
if (result != 0)
{
LOC_LOGE("chown for pipe failed, pipe %s, gid = %d, result = %d, error = %s\n",
global_loc_api_q_path, gps_group->gr_gid, result, strerror(errno));
}
}
else
{
LOC_LOGE("getgrnam for gps failed, error code = %d\n", errno);
}
loc_api_resp_msgqid = loc_eng_dmn_conn_glue_msgget(global_loc_api_resp_q_path, O_RDWR);
//change mode/group for the global_loc_api_resp_q_path pipe
result = chmod (global_loc_api_resp_q_path, 0660);
if (result != 0)
{
LOC_LOGE("failed to change mode for %s, error = %s\n", global_loc_api_resp_q_path, strerror(errno));
}
if (gps_group != NULL)
{
result = chown (global_loc_api_resp_q_path, -1, gps_group->gr_gid);
if (result != 0)
{
LOC_LOGE("chown for pipe failed, pipe %s, gid = %d, result = %d, error = %s\n",
global_loc_api_resp_q_path,
gps_group->gr_gid, result, strerror(errno));
}
}
quipc_msgqid = loc_eng_dmn_conn_glue_msgget(global_quipc_ctrl_q_path, O_RDWR);
msapm_msgqid = loc_eng_dmn_conn_glue_msgget(global_msapm_ctrl_q_path , O_RDWR);
msapu_msgqid = loc_eng_dmn_conn_glue_msgget(global_msapu_ctrl_q_path , O_RDWR);
LOC_LOGD("%s:%d] loc_api_server_msgqid = %d\n", __func__, __LINE__, loc_api_server_msgqid);
return 0;
}
示例10: loc_api_server_proc
static int loc_api_server_proc(void *context)
{
int length, sz;
int result = 0;
static int cnt = 0;
struct ctrl_msgbuf * p_cmsgbuf;
struct ctrl_msgbuf cmsg_resp;
sz = sizeof(struct ctrl_msgbuf) + 256;
p_cmsgbuf = (struct ctrl_msgbuf *) malloc(sz);
if (!p_cmsgbuf) {
LOC_LOGE("%s:%d] Out of memory\n", __func__, __LINE__);
return -1;
}
cnt ++;
LOC_LOGD("%s:%d] %d listening on %s...\n", __func__, __LINE__, cnt, (char *) context);
length = loc_eng_dmn_conn_glue_msgrcv(loc_api_server_msgqid, p_cmsgbuf, sz);
if (length <= 0) {
free(p_cmsgbuf);
LOC_LOGE("%s:%d] fail receiving msg from gpsone_daemon, retry later\n", __func__, __LINE__);
usleep(1000);
return 0;
}
LOC_LOGD("%s:%d] received ctrl_type = %d\n", __func__, __LINE__, p_cmsgbuf->ctrl_type);
switch(p_cmsgbuf->ctrl_type) {
case GPSONE_LOC_API_IF_REQUEST:
result = loc_eng_dmn_conn_loc_api_server_if_request_handler(p_cmsgbuf, length);
break;
case GPSONE_LOC_API_IF_RELEASE:
result = loc_eng_dmn_conn_loc_api_server_if_release_handler(p_cmsgbuf, length);
break;
case GPSONE_UNBLOCK:
LOC_LOGD("%s:%d] GPSONE_UNBLOCK\n", __func__, __LINE__);
break;
default:
LOC_LOGE("%s:%d] unsupported ctrl_type = %d\n",
__func__, __LINE__, p_cmsgbuf->ctrl_type);
break;
}
free(p_cmsgbuf);
return 0;
}
示例11: LOC_LOGD
/**
* @brief Starts a data call using the profile number provided
*
* The function uses parameters provided from @a ds_client_open_call_type
* call result.
*
* @param[in] client_handle Client handle
* @param[in] profile_index Profile index
* @param[in] pdp_type PDP type
*
* @return Operation result
* @retval E_DS_CLIENT_SUCCESS On success.
* @retval E_DS_CLIENT_FAILURE... On error.
*/
static ds_client_status_enum_type ds_client_start_call
(
dsClientHandleType client_handle,
int profile_index,
int pdp_type
)
{
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);
//Set IP Version as call parameter
param_info.buf_val = NULL;
param_info.num_val = pdp_type;
dsi_set_data_call_param(dsi_handle,
DSI_CALL_INFO_IP_VERSION,
¶m_info);
LOC_LOGD("%s:%d]: Starting emergency call with profile index %d; pdp_type:%d\n",
__func__, __LINE__, profile_index, pdp_type);
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;
}
示例12: ds_client_get_profile_settings
/*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;
}
示例13: loc_eng_inject_xtra_data_in_buffer
/*===========================================================================
FUNCTION loc_eng_inject_xtra_data_in_buffer
DESCRIPTION
Injects buffered XTRA file into the engine and clears the buffer.
DEPENDENCIES
N/A
RETURN VALUE
0: success
>0: failure
SIDE EFFECTS
N/A
===========================================================================*/
int loc_eng_inject_xtra_data_in_buffer()
{
int rc = 0;
char *data;
int length;
pthread_mutex_lock(&loc_eng_data.xtra_module_data.lock);
data = loc_eng_data.xtra_module_data.xtra_data_for_injection;
length = loc_eng_data.xtra_module_data.xtra_data_len;
loc_eng_data.xtra_module_data.xtra_data_for_injection = NULL;
loc_eng_data.xtra_module_data.xtra_data_len = 0;
pthread_mutex_unlock(&loc_eng_data.xtra_module_data.lock);
if (data)
{
if (qct_loc_eng_inject_xtra_data(data, length))
{
// FIXME gracefully handle injection error
LOC_LOGE("XTRA injection failed.");
rc = -1;
}
free(data);
}
return rc;
}
示例14: linked_list_flush
/*===========================================================================
FUNCTION: linked_list_flush
===========================================================================*/
linked_list_err_type linked_list_flush(void* list_data)
{
if( list_data == NULL )
{
LOC_LOGE("%s: Invalid list parameter!\n", __FUNCTION__);
return eLINKED_LIST_INVALID_HANDLE;
}
list_state* p_list = (list_state*)list_data;
/* Remove all dynamically allocated elements */
while( p_list->p_head != NULL )
{
list_element* tmp = p_list->p_head->next;
/* Free data pointer if told to do so. */
if( p_list->p_head->dealloc_func != NULL )
{
p_list->p_head->dealloc_func(p_list->p_head->data_ptr);
}
/* Free list element */
free(p_list->p_head);
p_list->p_head = tmp;
}
p_list->p_tail = NULL;
return eLINKED_LIST_SUCCESS;
}
示例15: ulp_msg_forward_quipc_coarse_position_request
/*===========================================================================
FUNCTION ulp_msg_forward_quipc_coarse_position_request
DESCRIPTION
This function is called when libulp module need to forward coarse
position request from ULP named pipe to message queue. This is done
so that all ULP state transition is done in one thread.
DEPENDENCIES
None
RETURN VALUE
0: success
-1: failure
SIDE EFFECTS
N/A
===========================================================================*/
int ulp_msg_forward_quipc_coarse_position_request ()
{
int ret_val = -1;
ENTRY_LOG_CALLFLOW();
do
{
// Forward the coarse position request in ULP named pipe to ULP message queue
// so that all state transition is done in one thread
ulp_msg *msg(new ulp_msg(&ulp_data, ULP_MSG_REQUEST_COARSE_POSITION));
if (msg == NULL)
{
LOC_LOGE ("%s, failed to create message: ULP_MSG_REQUEST_COARSE_POSITION \n", __func__);
break;
}
msg_q_snd(ulp_data.loc_proxy->mQ, msg, ulp_msg_free);
ret_val = 0;
} while (0);
EXIT_LOG(%d, ret_val);
return ret_val;
}