Go to the documentation of this file.
19 const auto begin = buffer.cbegin();
21 const auto end = buffer.end();
27 while ((it <
end) && (typeStr.size() < 3))
29 typeStr.push_back(
static_cast<char>(*it++));
34 else if (typeStr ==
"sRA")
36 else if (typeStr ==
"sWN")
38 else if (typeStr ==
"sWA")
40 else if (typeStr ==
"sMN")
42 else if (typeStr ==
"sAN")
44 else if (typeStr ==
"sFA")
54 std::uint16_t erroru16;
55 if (!EndianConv::convertFrom(erroru16, it,
end))
73 if ((it ==
end) || (
static_cast<char>(*it) !=
' '))
84 it = std::find(it,
end,
static_cast<std::uint8_t
>(
' '));
94 m_name.reserve(
static_cast<std::size_t
>(it - name_start));
95 for (
auto nameit = name_start; nameit < it; ++nameit)
97 m_name.push_back(
static_cast<char>(*nameit));
122 : m_type(commandType), m_name(name), m_parameterOffset(0u), m_error(error)
127 : m_buffer(buffer), m_type(CoLaCommandType::
UNKNOWN), m_parameterOffset(0), m_error(CoLaError::
UNKNOWN)
std::size_t getParameterOffset() const
Get offset in bytes to where first parameter starts.
static CoLaCommand networkErrorCommand()
Create a command for network errors.
CoLaError::Enum getError() const
Get error.
@ NETWORK_ERROR
Network error (not sent with messages).
CoLaCommandType::Enum m_type
Enum
Possible CoLa errors.
auto_any< BOOST_DEDUCED_TYPENAME foreach_iterator< T, C >::type > begin(auto_any_t col, type2type< T, C > *, boost::mpl::true_ *)
const ByteBuffer & getBuffer() const
Get the binary data buffer.
auto_any< BOOST_DEDUCED_TYPENAME foreach_iterator< T, C >::type > end(auto_any_t col, type2type< T, C > *, boost::mpl::true_ *)
const char * getName() const
Get the name of command.
CoLaCommandType::Enum getType() const
Get the type of command.
@ WRITE_VARIABLE_RESPONSE
bool fromBuffer(const ByteBuffer &buffer)
Decode a CoLa command from a given buffer.
std::vector< std::uint8_t > ByteBuffer
std::size_t m_parameterOffset
@ UNKNOWN
Unknown error, internally thrown if SOPAS Scan received an unknown command.
sick_visionary_ros
Author(s): SICK AG TechSupport 3D Snapshot
autogenerated on Thu Feb 8 2024 03:38:05