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

#include <SafeVisionaryControl.h>

Public Types

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

Public Member Functions

void close ()
 
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 (const std::string &hostname, uint8_t sessionTimeout_s=kSessionTimeout_s)
 
 SafeVisionaryControl ()
 
CoLaCommand sendCommand (CoLaCommand &command)
 Send a CoLaBCommand to the device and waits for the result. More...
 
 ~SafeVisionaryControl ()
 

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 34 of file SafeVisionaryControl.h.

Member Enumeration Documentation

◆ ProtocolType

The numbers used for the protocols are the port numbers.

Enumerator
INVALID_PROTOCOL 
COLA_2 

Definition at line 38 of file SafeVisionaryControl.h.

Constructor & Destructor Documentation

◆ SafeVisionaryControl()

visionary::SafeVisionaryControl::SafeVisionaryControl ( )

Definition at line 35 of file SafeVisionaryControl.cpp.

◆ ~SafeVisionaryControl()

visionary::SafeVisionaryControl::~SafeVisionaryControl ( )

Definition at line 37 of file SafeVisionaryControl.cpp.

Member Function Documentation

◆ close()

void visionary::SafeVisionaryControl::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 74 of file SafeVisionaryControl.cpp.

◆ getDeviceIdent()

std::string visionary::SafeVisionaryControl::getDeviceIdent ( )

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

Returns
True if successful, false otherwise.

Definition at line 107 of file SafeVisionaryControl.cpp.

◆ login()

bool visionary::SafeVisionaryControl::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 97 of file SafeVisionaryControl.cpp.

◆ logout()

bool visionary::SafeVisionaryControl::logout ( )

Logout from the device.

Returns
True if logout was successful, false otherwise.

Definition at line 102 of file SafeVisionaryControl.cpp.

◆ open()

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

Opens a connection to a SafeVisionary sensor

Parameters
[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)

Definition at line 39 of file SafeVisionaryControl.cpp.

◆ receiveCoLaCommand()

CoLaCommand visionary::SafeVisionaryControl::receiveCoLaCommand ( )
private

◆ receiveCoLaResponse()

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

◆ sendCommand()

CoLaCommand visionary::SafeVisionaryControl::sendCommand ( CoLaCommand command)

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

Parameters
commandCommand to send
Returns
The response.

Definition at line 122 of file SafeVisionaryControl.cpp.

Member Data Documentation

◆ kSessionTimeout_s

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

Default session timeout in seconds.

Definition at line 45 of file SafeVisionaryControl.h.

◆ m_pAuthentication

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

Definition at line 95 of file SafeVisionaryControl.h.

◆ m_pControlSession

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

Definition at line 96 of file SafeVisionaryControl.h.

◆ m_pProtocolHandler

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

Definition at line 94 of file SafeVisionaryControl.h.

◆ m_pTransport

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

Definition at line 93 of file SafeVisionaryControl.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