driver/src/sick_scan_common_nw.cpp
void SickScanCommonNw::removeFrameFromReceiveBuffer(UINT32 frameLength)
{
  // Remove frame from receive buffer
  if (frameLength < m_numberOfBytesInReceiveBuffer)
  {
    // More data in buffer, move them to the buffer start
    UINT32 newLen = m_numberOfBytesInReceiveBuffer - frameLength;
    printInfoMessage("SickScanCommonNw::removeFrameFromReceiveBuffer: Removing " + ::toString(frameLength) +
                     " bytes from the input buffer. New length is " + ::toString(newLen) + " bytes.", m_beVerbose);
    memmove(m_receiveBuffer, &(m_receiveBuffer[frameLength]), newLen);
    m_numberOfBytesInReceiveBuffer = newLen;
  }
  else
  {
    // No other data in buffer, just mark as empty
    printInfoMessage("SickScanCommonNw::removeFrameFromReceiveBuffer: Done, no more data in input buffer.",
                     m_beVerbose);
    m_numberOfBytesInReceiveBuffer = 0;
  }
}
//
// Removes a complete frame - in any protocol - from the main input buffer.
//
Removes a complete frame - in any protocol - from the main input buffer.
Removes a complete frame - in any protocol - from the main input buffer .
void SickScanCommonNw::removeFrameFromReceiveBuffer(UINT32 frameLength)
{
  if (frameLength < m_numberOfBytesInReceiveBuffer)
  {
    UINT32 newLen = m_numberOfBytesInReceiveBuffer - frameLength;
    printInfoMessage("SickScanCommonNw::removeFrameFromReceiveBuffer: Removing " + ::toString(frameLength) +
                     " bytes from the input buffer. New length is " + ::toString(newLen) + " bytes.", m_beVerbose);
    memmove(m_receiveBuffer, &(m_receiveBuffer[frameLength]), newLen);
    m_numberOfBytesInReceiveBuffer = newLen;
  }
  else
  {
    printInfoMessage("SickScanCommonNw::removeFrameFromReceiveBuffer: Done, no more data in input buffer.",
                     m_beVerbose);
    m_numberOfBytesInReceiveBuffer = 0;
  }
}
void SickScanCommonNw :: removeFrameFromReceiveBuffer ( UINT32 frameLength ) { if ( frameLength < m_numberOfBytesInReceiveBuffer ) { UINT32 newLen = m_numberOfBytesInReceiveBuffer - frameLength ; printInfoMessage ( " " + :: toString ( frameLength ) + " " + :: toString ( newLen ) + " " , m_beVerbose ) ; memmove ( m_receiveBuffer , & ( m_receiveBuffer [ frameLength ] ) , newLen ) ; m_numberOfBytesInReceiveBuffer = newLen ; } else { printInfoMessage ( " " , m_beVerbose ) ; m_numberOfBytesInReceiveBuffer = 0 ; } }
Removes a complete frame - in any protocol - from the main input buffer.
Removes a complete frame - in any protocol - from the main input buffer .
// Remove frame from receive buffer // More data in buffer, move them to the buffer start // No other data in buffer, just mark as empty