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; }
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; }
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; }
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; }
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; }
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; }