Class SafeVisionaryControl

Class Documentation

class SafeVisionaryControl

Public Types

enum ProtocolType

The numbers used for the protocols are the port numbers.

Values:

enumerator INVALID_PROTOCOL
enumerator COLA_2

Public Functions

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

Opens a connection to a SafeVisionary sensor

Parameters:
  • hostname[in] name or IP address of the Visionary sensor.

  • sessionTimeout_s[in] timeout of session in seconds

Return values:
  • true – The connection to the sensor successfully was established.

  • false – The 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)

void 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.

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

Login to the device.

Parameters:
  • userLevel[in] The user level to login as.

  • password[in] Password for the selected user level.

Returns:

error code, 0 on success

bool logout()

Logout from the device.

Returns:

True if logout was successful, false otherwise.

std::string getDeviceIdent()

Get device information by calling the “DeviceIdent” method on the device.

Returns:

True if successful, false otherwise.

CoLaCommand sendCommand(CoLaCommand &command)

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

Parameters:

command – Command to send

Returns:

The response.

Public Static Attributes

static const uint8_t kSessionTimeout_s = 5u

Default session timeout in seconds.