Go to the documentation of this file.
23 : m_protocolType(INVALID_PROTOCOL), m_sessionTimeout_ms(0), m_connectTimeout_ms(0), m_autoReconnect(false)
30 const std::string& hostname,
31 uint32_t sessionTimeout_ms,
33 uint32_t connectTimeout_ms)
43 std::unique_ptr<TcpSocket> pTransport(
new TcpSocket());
50 const uint16_t portno =
static_cast<uint16_t
>(type);
51 if (pTransport->connect(hostname, portno, connectTimeout_ms) != 0)
56 std::unique_ptr<IProtocolHandler> pProtocolHandler;
71 const uint32_t sessionTimeout_s = sessionTimeout_ms / 1000;
72 const uint32_t max_sessionTimeout_s = std::numeric_limits<uint8_t>::max();
74 if (sessionTimeout_s > max_sessionTimeout_s)
79 if (!pProtocolHandler->openSession(
static_cast<uint8_t
>(sessionTimeout_s)))
81 pTransport->shutdown();
85 std::unique_ptr<ControlSession> pControlSession;
86 pControlSession = std::unique_ptr<ControlSession>(
new ControlSession(*pProtocolHandler));
88 std::unique_ptr<IAuthentication> pAuthentication;
const std::string response
UserLevel
Available CoLa user levels.
Class for reading data from a CoLaCommand.
uint16_t GetBlobPort()
Get blob port address.
bool startAcquisition()
Start streaming the data by calling the "PLAYSTART" method on the device. Works only when acquisition...
Builder for constructing CoLaCommands.
ROSLIB_DECL std::string command(const std::string &cmd)
uint32_t m_sessionTimeout_ms
@ NETWORK_ERROR
Network error (not sent with messages).
bool getDataStreamConfig()
Tells the device that there is a streaming channel by invoking a method named GetBlobClientConfig.
ProtocolType
The numbers used for the protocols are the port numbers.
std::string getDeviceIdent()
Get device information by calling the "DeviceIdent" method on the device.
std::unique_ptr< ControlSession > m_pControlSession
bool stopAcquisition()
Stops the data stream. Works always, also when acquisition is already stopped before.
std::unique_ptr< IProtocolHandler > m_pProtocolHandler
uint32_t m_connectTimeout_ms
bool login(IAuthentication::UserLevel userLevel, const std::string &password)
ProtocolType m_protocolType
bool open(ProtocolType type, const std::string &hostname, uint32_t sessionTimeout_ms=kSessionTimeout_ms, bool autoReconnect=true, uint32_t connectTimeout_ms=kSessionTimeout_ms)
std::unique_ptr< TcpSocket > m_pTransport
@ SESSION_UNKNOWN_ID
The CoLa2 session id is not valid, either it timed out or it never existed.
CoLaParameterWriter & parameterUInt(const uint16_t uInt)
Add a unsigned int (16-bit, range [0, 65535]).
uint16_t readUInt()
Read a unsigned int (16 bit, range [0, 65535]) and advances position by 2 bytes. Throws an std::out_o...
bool logout()
Logout from the device.
bool stepAcquisition()
Trigger a single image on the device. Works only when acquisition is stopped.
CoLaCommand sendCommand(const CoLaCommand &command)
Send a CoLaBCommand to the device and waits for the result.
std::unique_ptr< IAuthentication > m_pAuthentication
BOOST_MOVE_FORCEINLINE ::boost::move_detail::remove_reference< T >::type && move(T &&t) BOOST_NOEXCEPT
std::string readFlexString()
Read a flex string, and advance position according to string size. Throws an std::out_of_range except...
bool burstAcquisition(uint16_t burstLen)
Start streaming a burst of data by calling the "PLAYBURST" method on the device. Works only when acqu...
const CoLaCommand build()
sick_visionary_ros
Author(s): SICK AG TechSupport 3D Snapshot
autogenerated on Thu Feb 8 2024 03:56:19