driver/src/sick_scan_common.cpp
bool SickScanCommon::checkForProtocolChangeAndMaybeReconnect(bool &useBinaryCmdNow)
  {
    bool retValue = true;
    bool shouldUseBinary = this->parser_->getCurrentParamPtr()->getUseBinaryProtocol();
    if (shouldUseBinary == useBinaryCmdNow)
    {
      retValue = true;  // !!!! CHANGE ONLY FOR TEST!!!!!
    }
    else
    {
      /*
            // we must reconnect and set the new protocoltype
            int iRet = this->close_device();
            ROS_INFO("SOPAS - Close and reconnected to scanner due to protocol change and wait 15 sec. ");
            ROS_INFO_STREAM("SOPAS - Changing from " << shouldUseBinary ? "ASCII" : "BINARY" << " to " << shouldUseBinary ? "BINARY" : "ASCII" << "\n");
            // Wait a few seconds after rebooting
            rosSleep(15.0);

            iRet = this->init_device();
            */
      if (shouldUseBinary == true)
      {
        this->setProtocolType(CoLa_B);
      }
      else
      {
        this->setProtocolType(CoLa_A);
      }

      useBinaryCmdNow = shouldUseBinary;
      retValue = false;
    }
    return (retValue);
  }
/*!
  \brief checks the current protocol type and gives information about necessary change

  \param useBinaryCmdNow Input/Output: Holds information about current protocol
  \return true, if protocol type is already the right one
  */
\brief checks the current protocol type and gives information about necessary change
\param useBinaryCmdNow Input/Output: Holds information about current protocol
\return true, if protocol type is already the right one
\ brief checks the current protocol type and gives information about necessary change \ param useBinaryCmdNow Input / Output : Holds information about current protocol \ return true if protocol type is already the right one
bool SickScanCommon::checkForProtocolChangeAndMaybeReconnect(bool &useBinaryCmdNow)
  {
    bool retValue = true;
    bool shouldUseBinary = this->parser_->getCurrentParamPtr()->getUseBinaryProtocol();
    if (shouldUseBinary == useBinaryCmdNow)
    {
      retValue = true;  
    }
    else
    {
      if (shouldUseBinary == true)
      {
        this->setProtocolType(CoLa_B);
      }
      else
      {
        this->setProtocolType(CoLa_A);
      }
      useBinaryCmdNow = shouldUseBinary;
      retValue = false;
    }
    return (retValue);
  }
bool SickScanCommon :: checkForProtocolChangeAndMaybeReconnect ( bool & useBinaryCmdNow ) { bool retValue = true ; bool shouldUseBinary = this -> parser_ -> getCurrentParamPtr ( ) -> getUseBinaryProtocol ( ) ; if ( shouldUseBinary == useBinaryCmdNow ) { retValue = true ; } else { if ( shouldUseBinary == true ) { this -> setProtocolType ( CoLa_B ) ; } else { this -> setProtocolType ( CoLa_A ) ; } useBinaryCmdNow = shouldUseBinary ; retValue = false ; } return ( retValue ) ; }
\brief checks the current protocol type and gives information about necessary change
\param useBinaryCmdNow Input/Output: Holds information about current protocol
\return true, if protocol type is already the right one
\ brief checks the current protocol type and gives information about necessary change \ param useBinaryCmdNow Input / Output : Holds information about current protocol \ return true if protocol type is already the right one
// !!!! CHANGE ONLY FOR TEST!!!!! /*
            // we must reconnect and set the new protocoltype
            int iRet = this->close_device();
            ROS_INFO("SOPAS - Close and reconnected to scanner due to protocol change and wait 15 sec. ");
            ROS_INFO_STREAM("SOPAS - Changing from " << shouldUseBinary ? "ASCII" : "BINARY" << " to " << shouldUseBinary ? "BINARY" : "ASCII" << "\n");
            // Wait a few seconds after rebooting
            rosSleep(15.0);

            iRet = this->init_device();
            */