driver/src/sick_scan_common.cpp
int SickScanCommon::convertSendSOPASCommand(const std::string& sopas_ascii_request, std::vector<unsigned char> *sopas_reply, bool wait_for_reply)
  {
    int result = ExitError;
    if (getProtocolType() == CoLa_B)
    {
      std::vector<unsigned char> requestBinary;
      convertAscii2BinaryCmd(sopas_ascii_request.c_str(), &requestBinary);
      ROS_INFO_STREAM("sick_scan_common: sending sopas command \"" << stripControl(requestBinary) << "\"");
      result = sendSOPASCommand((const char*)requestBinary.data(), sopas_reply, requestBinary.size(), wait_for_reply);
    }
    else
    {
      ROS_INFO_STREAM("sick_scan_common: sending sopas command \"" << sopas_ascii_request << "\"");
      result = sendSOPASCommand(sopas_ascii_request.c_str(), sopas_reply, sopas_ascii_request.size(), wait_for_reply);
    }
    return result;
  }
/// Converts a given SOPAS command from ascii to binary (in case of binary communication), sends sopas (ascii or binary) and returns the response (if wait_for_reply:=true)
/**
   * \param [in] request the command to send.
   * \param [in] cmdLen Length of the Comandstring in bytes used for Binary Mode only
   */
Converts a given SOPAS command from ascii to binary (in case of binary communication), sends sopas (ascii or binary) and returns the response (if wait_for_reply:=true)
\param [in] request the command to send.
\param [in] cmdLen Length of the Comandstring in bytes used for Binary Mode only
Converts a given SOPAS command from ascii to binary ( in case of binary communication ) sends sopas ( ascii or binary ) and returns the response ( if wait_for_reply : = true ) \ param [ in ] request the command to send . \ param [ in ] cmdLen Length of the Comandstring in bytes used for Binary Mode only
int SickScanCommon::convertSendSOPASCommand(const std::string& sopas_ascii_request, std::vector<unsigned char> *sopas_reply, bool wait_for_reply)
  {
    int result = ExitError;
    if (getProtocolType() == CoLa_B)
    {
      std::vector<unsigned char> requestBinary;
      convertAscii2BinaryCmd(sopas_ascii_request.c_str(), &requestBinary);
      ROS_INFO_STREAM("sick_scan_common: sending sopas command \"" << stripControl(requestBinary) << "\"");
      result = sendSOPASCommand((const char*)requestBinary.data(), sopas_reply, requestBinary.size(), wait_for_reply);
    }
    else
    {
      ROS_INFO_STREAM("sick_scan_common: sending sopas command \"" << sopas_ascii_request << "\"");
      result = sendSOPASCommand(sopas_ascii_request.c_str(), sopas_reply, sopas_ascii_request.size(), wait_for_reply);
    }
    return result;
  }
int SickScanCommon :: convertSendSOPASCommand ( const std :: string & sopas_ascii_request , std :: vector < unsigned char > * sopas_reply , bool wait_for_reply ) { int result = ExitError ; if ( getProtocolType ( ) == CoLa_B ) { std :: vector < unsigned char > requestBinary ; convertAscii2BinaryCmd ( sopas_ascii_request . c_str ( ) , & requestBinary ) ; ROS_INFO_STREAM ( " \" " << stripControl ( requestBinary ) << " \" " ) ; result = sendSOPASCommand ( ( const char * ) requestBinary . data ( ) , sopas_reply , requestBinary . size ( ) , wait_for_reply ) ; } else { ROS_INFO_STREAM ( " \" " << sopas_ascii_request << " \" " ) ; result = sendSOPASCommand ( sopas_ascii_request . c_str ( ) , sopas_reply , sopas_ascii_request . size ( ) , wait_for_reply ) ; } return result ; }
Converts a given SOPAS command from ascii to binary (in case of binary communication), sends sopas (ascii or binary) and returns the response (if wait_for_reply:=true)
 \param [in] request the command to send.
Converts a given SOPAS command from ascii to binary ( in case of binary communication ) sends sopas ( ascii or binary ) and returns the response ( if wait_for_reply : = true ) \ param [ in ] request the command to send .