Ejemplo n.º 1
0
void SYS_InitRpc(void)
{
	static int first_time = 1;
	/*UInt8 ret = 0; */

	if (first_time) {
		RPC_InitParams_t params = { 0 };
		RPC_SyncInitParams_t syncParams;

		params.iType = INTERFACE_RPC_DEFAULT;
		params.respCb = HandleSysEventRspCb;
		params.reqCb = HandleSysReqMsg;
		params.rpcNtfFn = HandleSysRPCNotification;
		params.mainProc = (xdrproc_t) xdr_SYS_ReqRep_t;
		sysGetXdrStruct(&(params.xdrtbl), &(params.table_size));
		params.maxDataBufSize = sizeof(SYS_ReqRep_t);

		syncParams.copyCb = SysCopyPayload;
		sRPCHandle = RPC_SyncRegisterClient(&params, &syncParams);

		BCMLOG_EnableLogId(BCMLOG_RPC_KERNEL_BASIC, 1);

		first_time = 0;

		/* SYS_TRACE("SYS_InitRpc\n"); */
	}
}
void SYS_InitRpc(void)
{
	static int first_time = 1;
	//UInt8 ret = 0;

	if(first_time)
	{
		RPC_InitParams_t params={0};
		RPC_SyncInitParams_t syncParams;

		params.iType = INTERFACE_RPC_DEFAULT;
		params.respCb = HandleSysEventRspCb;
		params.reqCb = HandleSysReqMsg;
		params.mainProc = xdr_SYS_ReqRep_t;
		sysGetXdrStruct(&(params.xdrtbl), &(params.table_size));
		params.maxDataBufSize = sizeof(SYS_ReqRep_t);
		
		syncParams.copyCb = SysCopyPayload;
		RPC_SyncRegisterClient(&params,&syncParams);

		first_time = 0;

		SYS_SyncTaskMsg();
#if defined(ENABLE_USB_MEGASIM)
        sys_usb_init();
#endif

#ifndef UNDER_LINUX
		SYS_TRACE( "SYS_InitRpc \n");
#endif
	}
}