2 * Hyper Operating System Application Framework
5 * @brief %jp{TCP/IP プロトコル}
7 * Copyright (C) 2006-2007 by Project HOS
8 * http://sourceforge.jp/projects/hos/
12 #include "tcpip_local.h"
16 FILE_SIZE TcpIp_Read(C_DRVOBJ *pDrvObj, C_FILEOBJ *pFileObj, void *pBuf, FILE_SIZE Size)
23 self = (C_TCPIP *)pDrvObj;
24 pFile = (C_TCPIPFILE *)pFileObj;
27 if ( pFile->iType == TCPIPFILE_TYPE_UDP )
29 unsigned short uhUdpSize;
31 while ( StreamBuf_RefDataSize(&pFile->RecvBuf) < sizeof(uhUdpSize) + sizeof(T_TCPIP_ADDRESS) )
33 SysEvt_Wait(pFile->hEvtRecv);
36 StreamBuf_RecvData(&pFile->RecvBuf, &uhUdpSize, sizeof(uhUdpSize));
37 StreamBuf_RecvData(&pFile->RecvBuf, pBuf, sizeof(T_TCPIP_ADDRESS) + (uhUdpSize - 8));
39 iRecvSize = sizeof(T_TCPIP_ADDRESS) + (uhUdpSize - 8);