VisionaryControl.h
Go to the documentation of this file.
1 // -- BEGIN LICENSE BLOCK ----------------------------------------------
20 // -- END LICENSE BLOCK ------------------------------------------------
21 
22 #pragma once
23 
24 #include "CoLaCommand.h"
25 #include "ControlSession.h"
26 #include "IAuthentication.h"
27 #include "IProtocolHandler.h"
28 #include "TcpSocket.h"
29 #include <cstdint>
30 #include <memory>
31 #include <string>
32 
33 namespace visionary {
34 
36 {
37 public:
40  {
42  COLA_A = 2111,
43  COLA_B = 2112,
44  COLA_2 = 2122
45  };
46 
48  static const uint8_t kSessionTimeout_s = 5u;
49 
52 
53 
67  bool open(ProtocolType type,
68  const std::string& hostname,
69  uint8_t sessionTimeout_s = kSessionTimeout_s);
70 
75  void close();
76 
77 
83  bool login(IAuthentication::UserLevel userLevel, const std::string password);
84 
87  bool logout();
88 
93  std::string getDeviceIdent();
94 
100  bool startAcquisition();
101 
106  bool stepAcquisition();
107 
111  bool stopAcquisition();
112 
118  bool getDataStreamConfig();
119 
124 
125 private:
126  std::string receiveCoLaResponse();
128 
129  std::unique_ptr<TcpSocket> m_pTransport;
130  std::unique_ptr<IProtocolHandler> m_pProtocolHandler;
131  std::unique_ptr<IAuthentication> m_pAuthentication;
132  std::unique_ptr<ControlSession> m_pControlSession;
133 };
134 
135 } // namespace visionary
visionary::IAuthentication::UserLevel
UserLevel
Available CoLa user levels.
Definition: IAuthentication.h:31
IAuthentication.h
TcpSocket.h
visionary::VisionaryControl::startAcquisition
bool startAcquisition()
Start streaming the data by calling the "PLAYSTART" method on the device. Works only when acquisition...
Definition: VisionaryControl.cpp:136
visionary
Definition: AuthenticationLegacy.h:25
visionary::CoLaCommand
Definition: CoLaCommand.h:32
visionary::VisionaryControl::~VisionaryControl
~VisionaryControl()
Definition: VisionaryControl.cpp:37
visionary::VisionaryControl::VisionaryControl
VisionaryControl()
Definition: VisionaryControl.cpp:35
visionary::VisionaryControl::getDataStreamConfig
bool getDataStreamConfig()
Tells the device that there is a streaming channel by invoking a method named GetBlobClientConfig.
Definition: VisionaryControl.cpp:162
visionary::VisionaryControl::ProtocolType
ProtocolType
The numbers used for the protocols are the port numbers.
Definition: VisionaryControl.h:39
visionary::VisionaryControl::getDeviceIdent
std::string getDeviceIdent()
Get device information by calling the "DeviceIdent" method on the device.
Definition: VisionaryControl.cpp:121
visionary::VisionaryControl::COLA_B
@ COLA_B
Definition: VisionaryControl.h:43
visionary::VisionaryControl::m_pControlSession
std::unique_ptr< ControlSession > m_pControlSession
Definition: VisionaryControl.h:132
visionary::VisionaryControl::COLA_A
@ COLA_A
Definition: VisionaryControl.h:42
ControlSession.h
visionary::VisionaryControl::kSessionTimeout_s
static const uint8_t kSessionTimeout_s
Default session timeout in seconds.
Definition: VisionaryControl.h:48
visionary::VisionaryControl::stopAcquisition
bool stopAcquisition()
Stops the data stream. Works always, also when acquisition is already stopped before.
Definition: VisionaryControl.cpp:154
visionary::VisionaryControl::m_pProtocolHandler
std::unique_ptr< IProtocolHandler > m_pProtocolHandler
Definition: VisionaryControl.h:130
visionary::VisionaryControl::login
bool login(IAuthentication::UserLevel userLevel, const std::string password)
Definition: VisionaryControl.cpp:111
IProtocolHandler.h
visionary::VisionaryControl::COLA_2
@ COLA_2
Definition: VisionaryControl.h:44
visionary::VisionaryControl::INVALID_PROTOCOL
@ INVALID_PROTOCOL
Definition: VisionaryControl.h:41
visionary::VisionaryControl::m_pTransport
std::unique_ptr< TcpSocket > m_pTransport
Definition: VisionaryControl.h:129
visionary::VisionaryControl::sendCommand
CoLaCommand sendCommand(CoLaCommand &command)
Send a CoLaBCommand to the device and waits for the result.
Definition: VisionaryControl.cpp:171
visionary::VisionaryControl::logout
bool logout()
Logout from the device.
Definition: VisionaryControl.cpp:116
visionary::VisionaryControl::open
bool open(ProtocolType type, const std::string &hostname, uint8_t sessionTimeout_s=kSessionTimeout_s)
Definition: VisionaryControl.cpp:39
visionary::VisionaryControl::close
void close()
Definition: VisionaryControl.cpp:88
visionary::VisionaryControl::stepAcquisition
bool stepAcquisition()
Trigger a single image on the device. Works only when acquisition is stopped.
Definition: VisionaryControl.cpp:146
CoLaCommand.h
visionary::VisionaryControl::m_pAuthentication
std::unique_ptr< IAuthentication > m_pAuthentication
Definition: VisionaryControl.h:131
visionary::VisionaryControl::receiveCoLaResponse
std::string receiveCoLaResponse()
visionary::VisionaryControl::receiveCoLaCommand
CoLaCommand receiveCoLaCommand()
visionary::VisionaryControl
Definition: VisionaryControl.h:35


sick_safevisionary_base
Author(s):
autogenerated on Sat Oct 21 2023 02:24:26