Exemple #1
0
RPC_Result_t RPC_PACKET_SendData(UInt8 rpcClientID,
				 PACKET_InterfaceType_t interfaceType,
				 UInt8 channel,
				 PACKET_BufHandle_t dataBufHandle)
{
	IPC_ReturnCode_T ipcError = IPC_ERROR;
	UInt8 *pCid =
	    (UInt8 *)IPC_BufferHeaderSizeSet((IPC_Buffer) dataBufHandle, 4);

	/*fixes compiler warnings */
	if (rpcClientID) ;

	if (pCid) {
		pCid[0] = channel;
		if (sCPResetting) {
			_DBG_(RPC_TRACE
			      ("RPC_PACKET_SendData: cp resetting, ignore send\n"));
			ipcError = IPC_ERROR;
		} else
			ipcError =
			    IPC_SendBuffer((IPC_Buffer) dataBufHandle,
					   IPC_PRIORITY_DEFAULT);
	}

	return (ipcError == IPC_OK) ? RPC_RESULT_OK : RPC_RESULT_ERROR;
}
Exemple #2
0
UInt8 RPC_PACKET_GetContext(PACKET_InterfaceType_t interfaceType,
			    PACKET_BufHandle_t dataBufHandle)
{
	UInt8 *pBuf =
	    (UInt8 *)IPC_BufferHeaderSizeSet((IPC_Buffer) dataBufHandle, 4);

	return (pBuf) ? pBuf[1] : 0xFF;
}
Exemple #3
0
RPC_Result_t RPC_PACKET_SetContext(PACKET_InterfaceType_t interfaceType, PACKET_BufHandle_t dataBufHandle, UInt8 context)
{
	UInt8* pBuf = (UInt8*)IPC_BufferHeaderSizeSet((IPC_Buffer)dataBufHandle , 4);

	if(pBuf)
		pBuf[1] = context;

	return (pBuf) ? RPC_RESULT_OK : RPC_RESULT_ERROR;
}
Exemple #4
0
RPC_Result_t RPC_PACKET_SendData(UInt8 rpcClientID, PACKET_InterfaceType_t interfaceType, UInt8 channel, PACKET_BufHandle_t dataBufHandle)
{
	IPC_ReturnCode_T ipcError;

	UInt8* pCid = (UInt8*)IPC_BufferHeaderSizeSet((IPC_Buffer)dataBufHandle , 4);
	pCid[0] = channel;

	if (rpcClientID) {} //fixes compiler warnings
	
	ipcError = IPC_SendBuffer((IPC_Buffer)dataBufHandle, IPC_PRIORITY_DEFAULT);

	return (ipcError == IPC_OK) ? RPC_RESULT_OK : RPC_RESULT_ERROR;
}
Exemple #5
0
UInt16 RPC_PACKET_GetContextEx(PACKET_InterfaceType_t interfaceType,
			       PACKET_BufHandle_t dataBufHandle)
{
	UInt16 context = 0;
	UInt8 *pBuf =
	    (UInt8 *)IPC_BufferHeaderSizeSet((IPC_Buffer) dataBufHandle, 4);

	if (pBuf) {
		context = (pBuf[3] << 8);
		context |= pBuf[2];
	}

	return context;
}
Exemple #6
0
RPC_Result_t RPC_PACKET_SetContextEx(PACKET_InterfaceType_t interfaceType,
				     PACKET_BufHandle_t dataBufHandle,
				     UInt16 context)
{
	UInt8 *pBuf =
	    (UInt8 *)IPC_BufferHeaderSizeSet((IPC_Buffer) dataBufHandle, 4);

	if (pBuf) {
		pBuf[2] = (UInt8)(context & 0xFF);
		pBuf[3] = (UInt8)((UInt16)((context & 0xFF00) >> 8));
	}

	return (pBuf) ? RPC_RESULT_OK : RPC_RESULT_ERROR;
}