Public Types | Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
visionary::VisionaryControl Class Reference

#include <VisionaryControl.h>

Public Types

enum  ProtocolType { INVALID_PROTOCOL = -1, COLA_A = 2111, COLA_B = 2112, COLA_2 = 2122 }
 The numbers used for the protocols are the port numbers. More...
 

Public Member Functions

void close ()
 
bool getDataStreamConfig ()
 Tells the device that there is a streaming channel by invoking a method named GetBlobClientConfig. More...
 
std::string getDeviceIdent ()
 Get device information by calling the "DeviceIdent" method on the device. More...
 
bool login (IAuthentication::UserLevel userLevel, const std::string password)
 
bool logout ()
 Logout from the device. More...
 
bool open (ProtocolType type, const std::string &hostname, uint8_t sessionTimeout_s=kSessionTimeout_s)
 
CoLaCommand sendCommand (CoLaCommand &command)
 Send a CoLaBCommand to the device and waits for the result. More...
 
bool startAcquisition ()
 Start streaming the data by calling the "PLAYSTART" method on the device. Works only when acquisition is stopped. More...
 
bool stepAcquisition ()
 Trigger a single image on the device. Works only when acquisition is stopped. More...
 
bool stopAcquisition ()
 Stops the data stream. Works always, also when acquisition is already stopped before. More...
 
 VisionaryControl ()
 
 ~VisionaryControl ()
 

Static Public Attributes

static const uint8_t kSessionTimeout_s = 5u
 Default session timeout in seconds. More...
 

Private Member Functions

CoLaCommand receiveCoLaCommand ()
 
std::string receiveCoLaResponse ()
 

Private Attributes

std::unique_ptr< IAuthenticationm_pAuthentication
 
std::unique_ptr< ControlSessionm_pControlSession
 
std::unique_ptr< IProtocolHandlerm_pProtocolHandler
 
std::unique_ptr< TcpSocketm_pTransport
 

Detailed Description

Definition at line 35 of file VisionaryControl.h.

Member Enumeration Documentation

◆ ProtocolType

The numbers used for the protocols are the port numbers.

Enumerator
INVALID_PROTOCOL 
COLA_A 
COLA_B 
COLA_2 

Definition at line 39 of file VisionaryControl.h.

Constructor & Destructor Documentation

◆ VisionaryControl()

visionary::VisionaryControl::VisionaryControl ( )

Definition at line 35 of file VisionaryControl.cpp.

◆ ~VisionaryControl()

visionary::VisionaryControl::~VisionaryControl ( )

Definition at line 37 of file VisionaryControl.cpp.

Member Function Documentation

◆ close()

void visionary::VisionaryControl::close ( )

Close a connection

Closes the control connection. It is allowed to call close of a connection that is not open. In this case this call is a no-op.

Definition at line 88 of file VisionaryControl.cpp.

◆ getDataStreamConfig()

bool visionary::VisionaryControl::getDataStreamConfig ( )

Tells the device that there is a streaming channel by invoking a method named GetBlobClientConfig.

Returns
True if successful, false otherwise.

Definition at line 162 of file VisionaryControl.cpp.

◆ getDeviceIdent()

std::string visionary::VisionaryControl::getDeviceIdent ( )

Get device information by calling the "DeviceIdent" method on the device.

Returns
True if successful, false otherwise.

Definition at line 121 of file VisionaryControl.cpp.

◆ login()

bool visionary::VisionaryControl::login ( IAuthentication::UserLevel  userLevel,
const std::string  password 
)

Login to the device.

Parameters
[in]userLevelThe user level to login as.
[in]passwordPassword for the selected user level.
Returns
error code, 0 on success

Definition at line 111 of file VisionaryControl.cpp.

◆ logout()

bool visionary::VisionaryControl::logout ( )

Logout from the device.

Returns
True if logout was successful, false otherwise.

Definition at line 116 of file VisionaryControl.cpp.

◆ open()

bool visionary::VisionaryControl::open ( ProtocolType  type,
const std::string &  hostname,
uint8_t  sessionTimeout_s = kSessionTimeout_s 
)

Opens a connection to a Visionary sensor

Parameters
[in]typeprotocol type the sensor understands (CoLa-A, CoLa-B or CoLa-2). This information is found in the sensor documentation.
[in]hostnamename or IP address of the Visionary sensor.
[in]sessionTimeout_stimeout of session in seconds
Return values
trueThe connection to the sensor successfully was established.
falseThe connection attempt failed; the sensor is either
  • switched off or has a different IP address or name
  • not available using for PCs network settings (different subnet)
  • the protocol type or the port did not match. Please check your sensor documentation.

Definition at line 39 of file VisionaryControl.cpp.

◆ receiveCoLaCommand()

CoLaCommand visionary::VisionaryControl::receiveCoLaCommand ( )
private

◆ receiveCoLaResponse()

std::string visionary::VisionaryControl::receiveCoLaResponse ( )
private

◆ sendCommand()

CoLaCommand visionary::VisionaryControl::sendCommand ( CoLaCommand command)

Send a CoLaBCommand to the device and waits for the result.

Parameters
commandCommand to send
Returns
The response.

Definition at line 171 of file VisionaryControl.cpp.

◆ startAcquisition()

bool visionary::VisionaryControl::startAcquisition ( )

Start streaming the data by calling the "PLAYSTART" method on the device. Works only when acquisition is stopped.

Returns
True if successful, false otherwise.

Definition at line 136 of file VisionaryControl.cpp.

◆ stepAcquisition()

bool visionary::VisionaryControl::stepAcquisition ( )

Trigger a single image on the device. Works only when acquisition is stopped.

Returns
True if successful, false otherwise.

Definition at line 146 of file VisionaryControl.cpp.

◆ stopAcquisition()

bool visionary::VisionaryControl::stopAcquisition ( )

Stops the data stream. Works always, also when acquisition is already stopped before.

Definition at line 154 of file VisionaryControl.cpp.

Member Data Documentation

◆ kSessionTimeout_s

const uint8_t visionary::VisionaryControl::kSessionTimeout_s = 5u
static

Default session timeout in seconds.

Definition at line 48 of file VisionaryControl.h.

◆ m_pAuthentication

std::unique_ptr<IAuthentication> visionary::VisionaryControl::m_pAuthentication
private

Definition at line 131 of file VisionaryControl.h.

◆ m_pControlSession

std::unique_ptr<ControlSession> visionary::VisionaryControl::m_pControlSession
private

Definition at line 132 of file VisionaryControl.h.

◆ m_pProtocolHandler

std::unique_ptr<IProtocolHandler> visionary::VisionaryControl::m_pProtocolHandler
private

Definition at line 130 of file VisionaryControl.h.

◆ m_pTransport

std::unique_ptr<TcpSocket> visionary::VisionaryControl::m_pTransport
private

Definition at line 129 of file VisionaryControl.h.


The documentation for this class was generated from the following files:


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