driver/src/sick_scan_common.cpp
int sick_scan::SickScanCommon::checkForBinaryAnswer(const std::vector<unsigned char> *reply)
  {
    int retVal = -1;

    if (reply == NULL)
    {
    }
    else
    {
      if (reply->size() < 8)
      {
        retVal = -1;
      }
      else
      {
        const unsigned char *ptr = &((*reply)[0]);
        unsigned binId = convertBigEndianCharArrayToUnsignedLong(ptr);
        unsigned cmdLen = convertBigEndianCharArrayToUnsignedLong(ptr + 4);
        if (binId == 0x02020202)
        {
          int replyLen = reply->size();
          if (replyLen == 8 + cmdLen + 1)
          {
            retVal = cmdLen;
          }
        }
      }
    }
    return (retVal);

  }
/*!
  \brief Check block for correct framing and starting sequence of a binary message
  \param reply Pointer to datablock
  \return length of message (-1 if message format is not correct)
  */
\brief Check block for correct framing and starting sequence of a binary message
\param reply Pointer to datablock
\return length of message (-1 if message format is not correct)
\ brief Check block for correct framing and starting sequence of a binary message \ param reply Pointer to datablock \ return length of message ( - 1 if message format is not correct )
int sick_scan::SickScanCommon::checkForBinaryAnswer(const std::vector<unsigned char> *reply)
  {
    int retVal = -1;
    if (reply == NULL)
    {
    }
    else
    {
      if (reply->size() < 8)
      {
        retVal = -1;
      }
      else
      {
        const unsigned char *ptr = &((*reply)[0]);
        unsigned binId = convertBigEndianCharArrayToUnsignedLong(ptr);
        unsigned cmdLen = convertBigEndianCharArrayToUnsignedLong(ptr + 4);
        if (binId == 0x02020202)
        {
          int replyLen = reply->size();
          if (replyLen == 8 + cmdLen + 1)
          {
            retVal = cmdLen;
          }
        }
      }
    }
    return (retVal);
  }
int sick_scan :: SickScanCommon :: checkForBinaryAnswer ( const std :: vector < unsigned char > * reply ) { int retVal = -1 ; if ( reply == NULL ) { } else { if ( reply -> size ( ) < 8 ) { retVal = -1 ; } else { const unsigned char * ptr = & ( ( * reply ) [ 0 ] ) ; unsigned binId = convertBigEndianCharArrayToUnsignedLong ( ptr ) ; unsigned cmdLen = convertBigEndianCharArrayToUnsignedLong ( ptr + 4 ) ; if ( binId == 0x02020202 ) { int replyLen = reply -> size ( ) ; if ( replyLen == 8 + cmdLen + 1 ) { retVal = cmdLen ; } } } } return ( retVal ) ; }
\brief Check block for correct framing and starting sequence of a binary message
\param reply Pointer to datablock
\return length of message (-1 if message format is not correct)
\ brief Check block for correct framing and starting sequence of a binary message \ param reply Pointer to datablock \ return length of message ( - 1 if message format is not correct )