当前位置: 首页>>代码示例>>C++>>正文


C++ Open_check函数代码示例

本文整理汇总了C++中Open_check函数的典型用法代码示例。如果您正苦于以下问题:C++ Open_check函数的具体用法?C++ Open_check怎么用?C++ Open_check使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了Open_check函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: battery_info_get

void battery_info_get(struct batt_info* resp_buf)
{

	struct oem_rapi_client_streaming_func_arg arg;
	struct oem_rapi_client_streaming_func_ret ret;
	uint32_t out_len;
	int ret_val;
	struct batt_info rsp_buf;

	Open_check();

	arg.event = LG_FW_A2M_BATT_INFO_GET;
	arg.cb_func = NULL;
	arg.handle = (void*) 0;
	arg.in_len = 0;
	arg.input = NULL;
	arg.out_len_valid = 1;
	arg.output_valid = 1;
	arg.output_size = sizeof(rsp_buf);

	ret.output = (char*)&rsp_buf;
	ret.out_len = &out_len;

	ret_val = oem_rapi_client_streaming_function(client, &arg, &ret);
	if(ret_val == 0) {
		resp_buf->valid_batt_id = GET_U_INT32(&rsp_buf.valid_batt_id);
		resp_buf->batt_therm = GET_U_INT32(&rsp_buf.batt_therm);
		resp_buf->batt_temp = GET_INT32(&rsp_buf.batt_temp);
	} else { /* In case error */
		resp_buf->valid_batt_id = 1; /* authenticated battery id */
		resp_buf->batt_therm = 100;  /* 100 battery therm adc */
		resp_buf->batt_temp = 30;    /* 30 degree celcius */
	}
	return;
}
开发者ID:venkatkamesh,项目名称:kernel-msm7x27-ics-3.0.8,代码行数:35,代码来源:LG_rapi_client.c

示例2: pseudo_batt_info_set

void pseudo_batt_info_set(struct pseudo_batt_info_type* info)
{
	struct oem_rapi_client_streaming_func_arg arg;
	struct oem_rapi_client_streaming_func_ret ret;
	int rc= -1;

	Open_check();

	arg.event = LG_FW_A2M_PSEUDO_BATT_INFO_SET;
	arg.cb_func = NULL;
	arg.handle = (void*) 0;
	arg.in_len = sizeof(struct pseudo_batt_info_type);
	arg.input = (char*)info;
	arg.out_len_valid = 0;
	arg.output_valid = 0;
	arg.output_size = 0;  /* alloc memory for response */

	ret.output = (char*)NULL;
	ret.out_len = 0;

	rc = oem_rapi_client_streaming_function(client, &arg, &ret);
	if (rc < 0)
	{
		pr_err("%s, rapi reqeust failed\r\n", __func__);
	}

/* MOD 0014591: [LG_RAPI] rpc request heap leakage bug fix */
	// free received buffers if it is not empty
	if (ret.output)
		kfree(ret.output);
	if (ret.out_len)
		kfree(ret.out_len);
	
	return;
}
开发者ID:venkatkamesh,项目名称:kernel-msm7x27-ics-3.0.8,代码行数:35,代码来源:LG_rapi_client.c

示例3: remote_eri_rpc

void remote_eri_rpc(void)
{
	struct oem_rapi_client_streaming_func_arg arg;
	struct oem_rapi_client_streaming_func_ret ret;
	int rc= -1;
	int errCount=0;
	int file_size=0;
	char fs_err_buf[20];

	memset(fs_err_buf, 0, sizeof(fs_err_buf));
	Open_check();

	do
	{
		arg.event = LGE_REQUEST_ERI_RPC;
		arg.cb_func = NULL;
		arg.handle = (void*) 0;
		arg.in_len =  sizeof(fs_err_buf);
		arg.input =fs_err_buf;
		arg.out_len_valid = 1;
		arg.output_valid = 1;
		arg.output_size = sizeof(eri_data);

		ret.output = NULL;
		ret.out_len = NULL;

		rc = oem_rapi_client_streaming_function(client,&arg,&ret);

		memset(fs_err_buf, 0, sizeof(fs_err_buf));
		//if ((rc < 0) || (GET_INT32(ret.output) <=0))
		if (rc < 0)
			pr_err("%s error \r\n", __func__);
		else
		{
			pr_info("%s succeeded, file size : %s\r\n",__func__, fs_err_to_string(GET_INT32(ret.output), fs_err_buf));
			pr_info("%s succeeded\r\n",__func__);
		}
	}while (rc < 0 && errCount++ < 3);

	if(ret.output == NULL || ret.out_len == NULL){ 
		printk(KERN_ERR "%s, output is NULL\n",__func__);
		return;
	}
	memcpy((void *)eri_data, ret.output, *ret.out_len);
	file_size=(int)*ret.out_len;
	//memcpy((void *)dest, psrc->output, *(psrc->out_len));

	eri_factory_direct_write(ERI_FILE_PATH, (char *)&eri_data,file_size );
	
		

/* MOD 0014591: [LG_RAPI] rpc request heap leakage bug fix */
	// free received buffers if it is not empty
	if (ret.output)
		kfree(ret.output);
	if (ret.out_len)
		kfree(ret.out_len);
	
	return;
}
开发者ID:venkatkamesh,项目名称:kernel-msm7x27-ics-3.0.8,代码行数:60,代码来源:LG_rapi_client.c

示例4: set_operation_mode

void set_operation_mode(boolean info)
{
	struct oem_rapi_client_streaming_func_arg arg;
	struct oem_rapi_client_streaming_func_ret ret;
	int rc= -1;

	Open_check();

	arg.event = LG_FW_SET_OPERATION_MODE;	
	arg.cb_func = NULL;
	arg.handle = (void*) 0;
	arg.in_len = sizeof(boolean);
	arg.input = (char*) &info;
	arg.out_len_valid = 0;
	arg.output_valid = 0;
	arg.output_size = 0;

	ret.output = (char*) NULL;
	ret.out_len = 0;

	rc = oem_rapi_client_streaming_function(client,&arg, &ret);
	if (rc < 0)
	{
		pr_err("%s, rapi reqeust failed\r\n", __func__);
	}

/* MOD 0014591: [LG_RAPI] rpc request heap leakage bug fix */
	// free received buffers if it is not empty

	if (ret.output)
		kfree(ret.output);
	if (ret.out_len)
		kfree(ret.out_len);

}
开发者ID:venkatkamesh,项目名称:kernel-msm7x27-ics-3.0.8,代码行数:35,代码来源:LG_rapi_client.c

示例5: send_to_arm9

void send_to_arm9(void*	pReq, void* pRsp)
{
    struct oem_rapi_client_streaming_func_arg arg;
    struct oem_rapi_client_streaming_func_ret ret;

    Open_check();

    arg.event = LG_FW_TESTMODE_EVENT_FROM_ARM11;
    arg.cb_func = NULL;
    arg.handle = (void*) 0;
    arg.in_len = sizeof(DIAG_TEST_MODE_F_req_type);
    arg.input = (char*)pReq;
    arg.out_len_valid = 1;
    arg.output_valid = 1;

    if( ((DIAG_TEST_MODE_F_req_type*)pReq)->sub_cmd_code == TEST_MODE_FACTORY_RESET_CHECK_TEST)
        arg.output_size = sizeof(DIAG_TEST_MODE_F_rsp_type) - sizeof(test_mode_rsp_type);
    else
        arg.output_size = sizeof(DIAG_TEST_MODE_F_rsp_type);

    ret.output = NULL;
    ret.out_len = NULL;

    oem_rapi_client_streaming_function(client, &arg, &ret);
    memcpy(pRsp,ret.output,*ret.out_len);

    return;
}
开发者ID:arjen75,项目名称:ics-lge-kernel-msm7x27-chick,代码行数:28,代码来源:LG_rapi_client.c

示例6: msm_get_MEID_type

void msm_get_MEID_type(char* sMeid)
{
    struct oem_rapi_client_streaming_func_arg arg;
    struct oem_rapi_client_streaming_func_ret ret;

    Open_check();

    arg.event = LG_FW_MEID_GET;
    arg.cb_func = NULL;
    arg.handle = (void*) 0;
    arg.in_len = 0;
    arg.input = NULL;
    arg.out_len_valid = 1;
    arg.output_valid = 1;
    arg.output_size = 15;

    ret.output = NULL;
    ret.out_len = NULL;

    oem_rapi_client_streaming_function(client, &arg, &ret);

    memcpy(sMeid,ret.output,14);

    kfree(ret.output);
    kfree(ret.out_len);

    return;
}
开发者ID:arjen75,项目名称:ics-lge-kernel-msm7x27-chick,代码行数:28,代码来源:LG_rapi_client.c

示例7: remote_set_charging_stat_realtime_update

void remote_set_charging_stat_realtime_update(int info)
{
	struct oem_rapi_client_streaming_func_arg arg;
	struct oem_rapi_client_streaming_func_ret ret;
	int ret_val;

	Open_check();

	arg.event = LG_FW_SET_CHARGING_STAT_REALTIME_UPDATE;
	arg.cb_func = NULL;
	arg.handle = (void *)0;
	arg.in_len = sizeof(int);
	arg.input = (char *)&info;
	arg.out_len_valid = 0;
	arg.output_valid = 0;
	arg.output_size = 0;	//alloc memory for response

	ret.output = NULL;
	ret.out_len = NULL;

	ret_val = oem_rapi_client_streaming_function(client, &arg, &ret);

	if (ret.output)
		kfree(ret.output);
	if (ret.out_len)
		kfree(ret.out_len);

	return;
}
开发者ID:rgocal,项目名称:lg_ally_kernel-2.6.XX,代码行数:29,代码来源:LG_rapi_client.c

示例8: remote_set_chg_logo_mode

void remote_set_chg_logo_mode(int info)
{
	struct oem_rapi_client_streaming_func_arg arg;
	struct oem_rapi_client_streaming_func_ret ret;
	int ret_val;

	Open_check();

	arg.event = LG_FW_CHG_LOGO_MODE;
	arg.cb_func = NULL;
	arg.handle = (void *)0;
	arg.in_len = sizeof(int);
	arg.input = (char *)&info;
	arg.out_len_valid = 0;
	arg.output_valid = 0;
	arg.output_size = 0;	//alloc memory for response

	ret.output = NULL;
	ret.out_len = NULL;

	ret_val = oem_rapi_client_streaming_function(client, &arg, &ret);

	if (ret.output)
		kfree(ret.output);
	if (ret.out_len)
		kfree(ret.out_len);

	return;
}
开发者ID:LDrifta,项目名称:Kernel_MS910_ZVD_Speed_Unlshd,代码行数:29,代码来源:LG_rapi_client.c

示例9: remote_rpc_request

int remote_rpc_request(uint32_t command)
{
	struct oem_rapi_client_streaming_func_arg arg;
	struct oem_rapi_client_streaming_func_ret ret;
	char output[4];
	int rc= -1;
	int request_cmd = command;

	Open_check();
	arg.event = LGE_RPC_HANDLE_REQUEST;
	arg.cb_func = NULL;
	arg.handle = (void*) 0;
	arg.in_len = sizeof(request_cmd);
	arg.input = (char*)&request_cmd;
	arg.out_len_valid = 1;
	arg.output_valid = 1;
	arg.output_size = sizeof(output);

	ret.output = (char*)NULL;
	ret.out_len = 0;

	rc = oem_rapi_client_streaming_function(client,&arg,&ret);
	if (rc < 0)
	{
		pr_err("%s, rapi reqeust failed\r\n", __func__);
	}
	else
	{
		rc = lg_rapi_check_validity_and_copy_result((void*)&ret, (char*)output, arg.output_size);
		if(rc == LG_RAPI_INVALID_RESPONSE)
			memset(output,0,sizeof(output));
		
		switch(command)
		{
#ifdef CONFIG_LGE_SYNC_CMD
			case LGE_SYNC_REQUEST:
				pr_info("%s, sync retry count : %d\r\n", __func__, GET_INT32(output));
				if(rc != LG_RAPI_SUCCESS)
					rc = -1;
				break;
#endif
#ifdef CONFIG_LGE_NOTIFY_RECOVERY_MODE
			case LGE_RECOVERY_NOTIFICATION:
				pr_info("%s, recovery notification retry count : %d\r\n", __func__, GET_INT32(output));
				if(rc != LG_RAPI_SUCCESS)
					rc = -1;
				break;
#endif
			default :
				break;
		}
	}
	
	if (ret.output)
		kfree(ret.output);
	if (ret.out_len)
		kfree(ret.out_len);
	
	return rc;
}
开发者ID:LDrifta,项目名称:Kernel_MS910_ZVD_Speed_Unlshd,代码行数:60,代码来源:LG_rapi_client.c

示例10: block_charging_set

void block_charging_set(int bypass)
{
	struct oem_rapi_client_streaming_func_arg arg;
	struct oem_rapi_client_streaming_func_ret ret;
	int rc= -1;

	Open_check();
	arg.event = LG_FW_A2M_BLOCK_CHARGING_SET;
	arg.cb_func = NULL;
	arg.handle = (void*) 0;
	arg.in_len = sizeof(int);
	arg.input = (char*) &bypass;
	arg.out_len_valid = 0;
	arg.output_valid = 0;
	arg.output_size = 0;

	ret.output = (char*)NULL;
	ret.out_len = 0;

	rc = oem_rapi_client_streaming_function(client,&arg,&ret);
	if (rc < 0)
	{
		pr_err("%s, rapi reqeust failed\r\n", __func__);
	}

/* MOD 0014591: [LG_RAPI] rpc request heap leakage bug fix */
	// free received buffers if it is not empty
	if (ret.output)
		kfree(ret.output);
	if (ret.out_len)
		kfree(ret.out_len);
	
	return;
}
开发者ID:venkatkamesh,项目名称:kernel-msm7x27-ics-3.0.8,代码行数:34,代码来源:LG_rapi_client.c

示例11: lte_uart_start_request

void lte_uart_start_request(int value)
{
	struct oem_rapi_client_streaming_func_arg arg;
	struct oem_rapi_client_streaming_func_ret ret;
	int rc= -1;

	Open_check();

	arg.event = LG_FW_LTE_UART_START_REQ;
	arg.cb_func = NULL;
	arg.handle = (void*) 0;
	arg.in_len = sizeof(int);
	arg.input = (char*) &value;
	arg.out_len_valid = 0;
	arg.output_valid = 0;
	arg.output_size = 0;  /* alloc memory for response */

	ret.output = (char*)NULL;
	ret.out_len = 0;

	rc = oem_rapi_client_streaming_function(client, &arg, &ret);
	if (rc < 0)
	{
		pr_err("%s, rapi reqeust failed\r\n", __func__);
	}

	// free received buffers if it is not empty
	if (ret.output)
		kfree(ret.output);
	if (ret.out_len)
		kfree(ret.out_len);
	
	return;
}
开发者ID:LDrifta,项目名称:Kernel_MS910_ZVD_Speed_Unlshd,代码行数:34,代码来源:LG_rapi_client.c

示例12: vslt_rpc_command_string

int vslt_rpc_command_string(char* in_data, int data_len, char* out_data)
{
	int i, ret, status = 0;
	int total_len = 0;
	char* offset = in_data;
	int total_pkt, last_pkt_len = 0;

	Open_check();

	total_len = data_len;
	total_pkt = (total_len / 120) + (total_len % 120 == 0 ? 0 : 1);
	last_pkt_len = (total_len % 120) + (total_len % 120 == 0 ? 120 : 0);
	
	for (i = 0; i < total_pkt; i++)
	{
		if(total_pkt-1 == i)
		{
			ret = last_pkt_len;
			status = RPC_LARGE_READ_FINISH;
		}
		else
		{
			ret = 120;
			status = RPC_LARGE_READ_CONTINUE;
		}
			
		pr_info(" *** vslt_rpc_command_string send loop (%d / %d)\n", i, total_pkt);
		if(remote_large_vslt_send_data(i, status, offset, &ret) <0 )
		{
			pr_err(" *** vslt_rpc_command_string send error..!!\n");
			return -1;
		}
		offset += ret;
	}
	status = 0;
	total_len = 0;
	ret =0;
	offset = out_data;
	
	for (i = 0; status != RPC_LARGE_READ_FINISH; i++)
	{
		pr_info(" *** vslt_rpc_command_string loop res (%d)\n", i);
		status = remote_large_vslt_response_data(i, offset, &ret);
		if (status < 0) {
			pr_err(" *** vslt_rpc_command_string res error..!!\n");
			return -1;
		}
		offset += ret;
		total_len +=ret;
	}

	out_data[total_len-1] = '\0';	

	pr_info(" *** vslt_rpc_command_string Done(%d bytes)..!!\n", total_len);
	return total_len;
}
开发者ID:smovox,项目名称:lge-kernel-lproj,代码行数:56,代码来源:LG_rapi_client.c

示例13: msm_chg_LG_cable_type

int msm_chg_LG_cable_type(void)
{
	struct oem_rapi_client_streaming_func_arg arg;
	struct oem_rapi_client_streaming_func_ret ret;
	char output[LG_RAPI_CLIENT_MAX_OUT_BUFF_SIZE];
	int retValue = 0;
	int rc = -1;
	int errCount = 0;

	Open_check();

	do {
		arg.event = LG_FW_RAPI_CLIENT_EVENT_GET_LINE_TYPE;
		arg.cb_func = NULL;
		arg.handle = (void *)0;
		arg.in_len = 0;
		arg.input = NULL;
		arg.out_len_valid = 1;
		arg.output_valid = 1;
		arg.output_size = 4;

		ret.output = NULL;
		ret.out_len = NULL;

		rc = oem_rapi_client_streaming_function(client, &arg, &ret);
		if (rc < 0) {
			retValue = old_cable_type;
		} 
		else {
			memcpy(output, ret.output, *ret.out_len);
			retValue = GET_INT32(output);

			if (retValue == 0) // no init cable 
				retValue = old_cable_type;
			else //read ok.
				old_cable_type = retValue;
		}

		if (ret.output)
			kfree(ret.output);
		if (ret.out_len)
			kfree(ret.out_len);

	} while (rc < 0 && errCount++ < 3);

#ifdef CONFIG_MACH_MSM7X27_THUNDERC_SPRINT
	if (lge_bd_rev < HW_PCB_REV_B && retValue == 10) // LT_130K
		retValue = 0;
#endif

	printk("USB Cable type: %s(): %d\n", __func__, retValue);
	return retValue;
}
开发者ID:ASYLUMSERVE-COMMUNICATIONS,项目名称:kernel,代码行数:53,代码来源:lg_rapi_client.c

示例14: msm_chg_LG_cable_type

int msm_chg_LG_cable_type(void)
{
char output[LG_RAPI_CLIENT_MAX_OUT_BUFF_SIZE];
	#if 0
	struct oem_rapi_client_streaming_func_arg arg;
	struct oem_rapi_client_streaming_func_ret ret;
//	char output[LG_RAPI_CLIENT_MAX_OUT_BUFF_SIZE];
	int rc= -1;
	int errCount= 0;

	Open_check();


	do 
	{
		arg.event = LG_FW_RAPI_CLIENT_EVENT_GET_LINE_TYPE;
		arg.cb_func = NULL;
		arg.handle = (void*) 0;
		arg.in_len = 0;
		arg.input = NULL;
		arg.out_len_valid = 1;
		arg.output_valid = 1;
		arg.output_size = 4;

		ret.output = NULL;
		ret.out_len = NULL;

		rc= oem_rapi_client_streaming_function(client, &arg, &ret);
	
		if (rc < 0)
			pr_err("get LG_cable_type error \r\n");
		else
			pr_info("msm_chg_LG_cable_type: %d \r\n", GET_INT32(ret.output));

	} while (rc < 0 && errCount++ < 3);


/* MOD 0015327: [KERNEL] LG RAPI validity check */
	memset(output, 0, LG_RAPI_CLIENT_MAX_OUT_BUFF_SIZE);

	rc = lg_rapi_check_validity_and_copy_result((void*)&ret, output, arg.output_size);

/* MOD 0014591: [LG_RAPI] rpc request heap leakage bug fix */
	// free received buffers if it is not empty
	if (ret.output)
		kfree(ret.output);
	if (ret.out_len)
		kfree(ret.out_len);
#endif 
	return (GET_INT32(output));  


}
开发者ID:venkatkamesh,项目名称:kernel-msm7x27-ics-3.0.8,代码行数:53,代码来源:LG_rapi_client.c

示例15: do_send_to_arm9

/* MOD 0014166: [KERNEL] send_to_arm9 work queue */
static void
do_send_to_arm9(void*	pReq, void* pRsp, int flag, unsigned int rsp_len)
{
	struct oem_rapi_client_streaming_func_arg arg;
	struct oem_rapi_client_streaming_func_ret ret;
	int rc= -1;

	Open_check();
	printk(KERN_INFO "%s %s start\n", __func__, (flag==NORMAL_WORK_FLAG)?"[N]":"[WQ]");

	arg.event = LG_FW_TESTMODE_EVENT_FROM_ARM11;
	arg.cb_func = NULL;
	arg.handle = (void*) 0;
	arg.in_len = sizeof(DIAG_TEST_MODE_F_req_type);
	arg.input = (char*)pReq;
	arg.out_len_valid = 1;
	arg.output_valid = 1;
	arg.output_size = rsp_len;

	ret.output = NULL;
	ret.out_len = NULL;

/* BEGIN: 0015327 [email protected] 20110204 */
/* MOD 0015327: [KERNEL] LG RAPI validity check */
	rc= oem_rapi_client_streaming_function(client, &arg, &ret);
	if (rc < 0)
	{
		pr_err("%s, rapi reqeust failed\r\n", __func__);
		((DIAG_TEST_MODE_F_rsp_type*)pRsp)->ret_stat_code = TEST_FAIL_S;
		
	}
	else
	{
		rc = lg_rapi_check_validity_and_copy_result((void*)&ret, (char*)pRsp, arg.output_size);
		if(rc == LG_RAPI_INVALID_RESPONSE)
		{
			((DIAG_TEST_MODE_F_rsp_type*)pRsp)->ret_stat_code = TEST_FAIL_S;
		}
	}
/* END: 0015327 [email protected] 20110204 */

/* BEGIN: 0014591 [email protected] 20110122 */
/* MOD 0014591: [LG_RAPI] rpc request heap leakage bug fix */
	// free received buffers if it is not empty
	if (ret.output)
		kfree(ret.output);
	if (ret.out_len)
		kfree(ret.out_len);
/* END: 0014591 [email protected] 2011022 */

	printk(KERN_INFO "%s %s end\n", __func__, (flag==NORMAL_WORK_FLAG)?"[N]":"[WQ]");
}
开发者ID:phenomx4,项目名称:android_kernel_lge_m3s-3.0,代码行数:53,代码来源:lge_rapi_client.c


注:本文中的Open_check函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。