本文整理汇总了C++中LOC_LOGD函数的典型用法代码示例。如果您正苦于以下问题:C++ LOC_LOGD函数的具体用法?C++ LOC_LOGD怎么用?C++ LOC_LOGD使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LOC_LOGD函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
示例2: 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;
}
示例3: 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;
}
示例4: loc_timer_start
void* loc_timer_start(unsigned int msec, loc_timer_callback cb_func,
void* caller_data)
{
timer_data *t=NULL;
pthread_attr_t tattr;
pthread_t id;
LOC_LOGD("%s:%d]: Enter\n", __func__, __LINE__);
if(cb_func == NULL || msec == 0) {
LOC_LOGE("%s:%d]: Error: Wrong parameters\n", __func__, __LINE__);
goto _err;
}
t = (timer_data *)calloc(1, sizeof(timer_data));
if(t == NULL) {
LOC_LOGE("%s:%d]: Could not allocate memory. Failing.\n",
__func__, __LINE__);
goto _err;
}
if(pthread_cond_init(&(t->timer_cond), NULL)) {
LOC_LOGE("%s:%d]: Pthread cond init failed\n", __func__, __LINE__);
goto t_err;
}
if(pthread_mutex_init(&(t->timer_mutex), NULL)) {
LOC_LOGE("%s:%d]: Pthread mutex init failed\n", __func__, __LINE__);
goto cond_err;
}
t->callback_func = cb_func;
t->user_data = caller_data;
t->time_msec = msec;
t->state = READY;
if (pthread_attr_init(&tattr)) {
LOC_LOGE("%s:%d]: Pthread mutex init failed\n", __func__, __LINE__);
goto mutex_err;
}
pthread_attr_setdetachstate(&tattr, PTHREAD_CREATE_DETACHED);
if(pthread_create(&(id), &tattr, timer_thread, (void *)t)) {
LOC_LOGE("%s:%d]: Could not create thread\n", __func__, __LINE__);
goto attr_err;
}
LOC_LOGD("%s:%d]: Created thread with id: %d\n",
__func__, __LINE__, (int)id);
goto _err;
attr_err:
pthread_attr_destroy(&tattr);
mutex_err:
pthread_mutex_destroy(&t->timer_mutex);
cond_err:
pthread_cond_destroy(&t->timer_cond);
t_err:
free(t);
t = NULL;
_err:
LOC_LOGD("%s:%d]: Exit\n", __func__, __LINE__);
return t;
}
示例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: 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;
}
示例7: 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;
}
示例8: requestRsrc
int ExtServicer :: requestRsrc(void *cb_data)
{
int ret=-1;
LOC_LOGD("Enter ExtServicer :: requestRsrc\n");
ret = callbackExt(cb_data);
LOC_LOGD("Exit ExtServicer :: requestRsrc\n");
return(ret);
}
示例9: 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);
}
}
}
示例10: ds_client_init
/**
* @brief Initialize the DS client service
*
* 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
*
* @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_init()
{
ds_client_status_enum_type ret = E_DS_CLIENT_SUCCESS;
LOC_LOGD("%s:%d]:Enter", __func__, __LINE__);
if(DSI_SUCCESS != dsi_init(DSI_MODE_GENERAL))
{
LOC_LOGE("%s:%d]:dsi_init failed", __func__, __LINE__);
ret = E_DS_CLIENT_FAILURE_GENERAL;
}
LOC_LOGD("%s:%d]:Exit", __func__, __LINE__);
return ret;
}
示例11: log_parsed_report
/* Logs parsed report */
static void log_parsed_report(const rpc_loc_parsed_position_s_type *parsed_report)
{
rpc_loc_session_status_e_type status = parsed_report->session_status;
LOC_LOGD("Session status: %s Valid mask: 0x%X\n",
loc_get_sess_status_name(status),
(uint) parsed_report->valid_mask);
LOC_LOGD("Latitude: %.7f (%s)\n", parsed_report->latitude,
log_final_interm_string(
(parsed_report->valid_mask & RPC_LOC_POS_VALID_LATITUDE) &&
parsed_report->session_status == RPC_LOC_SESS_STATUS_SUCCESS));
LOC_LOGD("Longitude: %.7f\n", parsed_report->longitude);
LOC_LOGD("Accuracy: %.7f\n", parsed_report->hor_unc_circular);
}
示例12: LOC_LOGD
AgpsState* AgpsReleasedState::onRsrcEvent(AgpsRsrcStatus event, void* data)
{
LOC_LOGD("AgpsReleasedState::onRsrcEvent; event:%d\n", (int)event);
if (mStateMachine->hasSubscribers()) {
LOC_LOGE("Error: %s subscriber list not empty!!!", whoami());
// I don't know how to recover from it. I am adding this rather
// for debugging purpose.
}
AgpsState* nextState = this;
switch (event)
{
case RSRC_SUBSCRIBE:
{
// no notification until we get RSRC_GRANTED
// but we need to add subscriber to the list
mStateMachine->addSubscriber((Subscriber*)data);
// request from connecivity service for NIF
//The if condition is added so that if the data call setup fails
//for DS State Machine, we want to retry in released state.
//for AGps State Machine, sendRsrcRequest() will always return success
if(!mStateMachine->sendRsrcRequest(GPS_REQUEST_AGPS_DATA_CONN)) {
// move the state to PENDING
nextState = mPendingState;
}
}
break;
case RSRC_UNSUBSCRIBE:
{
// the list should really be empty, nothing to remove.
// but we might as well just tell the client it is
// unsubscribed. False tolerance, right?
Subscriber* subscriber = (Subscriber*) data;
Notification notification(subscriber, event, false);
subscriber->notifyRsrcStatus(notification);
}
// break;
case RSRC_GRANTED:
case RSRC_RELEASED:
case RSRC_DENIED:
default:
LOC_LOGW("%s: unrecognized event %d", whoami(), event);
// no state change.
break;
}
LOC_LOGD("onRsrcEvent, old state %s, new state %s, event %d",
whoami(), nextState->whoami(), event);
return nextState;
}
示例13: 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;
}
示例14: loc_eng_dmn_conn_join_thelper
/*===========================================================================
FUNCTION loc_eng_dmn_conn_join_thelper
thelper - pointer to thelper instance
DESCRIPTION
This function will wait for the thread of thelper_main to finish
DEPENDENCIES
None
RETURN VALUE
0: success or negative value for failure
SIDE EFFECTS
N/A
===========================================================================*/
int loc_eng_dmn_conn_join_thelper(struct loc_eng_dmn_conn_thelper * thelper)
{
int result;
LOC_LOGD("%s:%d] 0x%lx\n", __func__, __LINE__, (long) thelper);
result = pthread_join(thelper->thread_id, NULL);
if (result != 0) {
LOC_LOGE("%s:%d] 0x%lx\n", __func__, __LINE__, (long) thelper);
}
LOC_LOGD("%s:%d] 0x%lx\n", __func__, __LINE__, (long) thelper);
thelper_signal_destroy(thelper);
return result;
}
开发者ID:MT-ParanoidAndroid,项目名称:android_hardware_qcom_gps,代码行数:33,代码来源:loc_eng_dmn_conn_thread_helper.c
示例15: loc_init
/*===========================================================================
FUNCTION loc_init
DESCRIPTION
Initialize the location engine, this include setting up global datas
and registers location engien with loc api service.
DEPENDENCIES
None
RETURN VALUE
0: success
SIDE EFFECTS
N/Ax
===========================================================================*/
static int loc_init(GpsCallbacks* callbacks)
{
ENTRY_LOG();
LOC_API_ADAPTER_EVENT_MASK_T event =
LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT |
LOC_API_ADAPTER_BIT_SATELLITE_REPORT |
LOC_API_ADAPTER_BIT_LOCATION_SERVER_REQUEST |
LOC_API_ADAPTER_BIT_ASSISTANCE_DATA_REQUEST |
LOC_API_ADAPTER_BIT_IOCTL_REPORT |
LOC_API_ADAPTER_BIT_STATUS_REPORT |
LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT |
LOC_API_ADAPTER_BIT_NI_NOTIFY_VERIFY_REQUEST;
LocCallbacks clientCallbacks = {loc_cb, /* location_cb */
callbacks->status_cb, /* status_cb */
sv_cb, /* sv_status_cb */
callbacks->nmea_cb, /* nmea_cb */
callbacks->set_capabilities_cb, /* set_capabilities_cb */
callbacks->acquire_wakelock_cb, /* acquire_wakelock_cb */
callbacks->release_wakelock_cb, /* release_wakelock_cb */
callbacks->create_thread_cb, /* create_thread_cb */
NULL, /* location_ext_parser */
NULL /* sv_ext_parser */};
gps_loc_cb = callbacks->location_cb;
gps_sv_cb = callbacks->sv_status_cb;
if (get_target_name() == TARGET_NAME_APQ8064_STANDALONE)
{
gps_conf.CAPABILITIES &= ~(GPS_CAPABILITY_MSA | GPS_CAPABILITY_MSB);
gss_fd = open("/dev/gss", O_RDONLY);
if (gss_fd < 0) {
LOC_LOGE("GSS open failed: %s\n", strerror(errno));
return NULL;
}
LOC_LOGD("GSS open success! CAPABILITIES %0x\n", gps_conf.CAPABILITIES);
}
int retVal = -1;
if (loc_eng_ulp_inf == NULL)
retVal = loc_eng_init(loc_afw_data, &clientCallbacks, event,
NULL);
else
retVal = loc_eng_init(loc_afw_data, &clientCallbacks, event,
loc_ulp_msg_sender);
int ret_val1 = loc_eng_ulp_init(loc_afw_data, loc_eng_ulp_inf);
LOC_LOGD("loc_eng_ulp_init returned %d\n",ret_val1);
EXIT_LOG(%d, retVal);
return retVal;
}