Like transmitting data, receiving data also take the use of F&eIT protocol data stream.
Therefore, check received packet for data stream, and the acquired stream data is the data you should receive.
Checking received packet for stream data.
PSVHEAD pSVHead;
pSVHead = (PSVHEAD)(RxBuffer);
if( ( ( pSVHead->bSVHCommand & SV_COMMAND_MASK ) != SV_DATA_STREAM ) ||
( pSVHead->wSVHId != SV_ID ) ||
( pSVHead->bSVHVer != SV_VER ) ) {
Checking the next reception of data;
}
If the received packet is stream packet, acquire the data.
At this time, restore the acquired data entry in pRxData and restore the size of acquired data in DataSize.
PSTRMHEAD pStrmHead;
pStrmHead = (PSTRMHEAD)( (DWORD)(RxBuffer) + sizeof(SVHEAD) );
if( ( pStrmHead->bSTRMVer != STRM_VER ) ||
( ( pStrmHead->bSTRMCommand & STRM_COMMAND_MASK ) != STRM_SEND ) ) {
Checking the next reception of data;
}
pRxData = (BYTE*)( (DWORD)(RxBuffer) + sizeof(SVHEAD) + sizeof(STRMHEAD) );
DataSize = pStrmHead->wSTRMSize;
(Note) For data stream, because media converter divides the data transmitted from the device connected to the media converter into appropriate size, and send them over LAN.
Therefore, the data stream receiver must use caution.