Class SafeVisionaryDataStream

Class Documentation

class SafeVisionaryDataStream

Public Functions

SafeVisionaryDataStream(std::shared_ptr<VisionaryData> dataHandler)
~SafeVisionaryDataStream()
bool openUdpConnection(std::uint16_t port)

Connects to the sensor data stream using the given UDP port

Parameters:

port[in] UDP port to bind

Return values:
  • true – The connection to the sensor data stream has been successfully established.

  • false – The connection attempt failed; the sensor is either

    • switched off or streams on a different UPD port

    • not available using for PCs network settings (different subnet)

    • the protocol type or the port did not match. Please check your sensor documentation.

bool openTcpConnection(std::uint16_t port, std::string deviceIpAddress)

Connects to the sensor data stream using the given TCP port and given IPAddress.

void closeUdpConnection()

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

void closeTcpConnection()
bool getNextBlobUdp()

Receive a single blob from the connected device and store it in buffer.

Returns:

Returns true when a complete blob has been successfully received.

bool getNextBlobTcp(std::vector<std::uint8_t> &receiveBufferPacketSize)
Returns:

Returns true when a complete blob has been successfully received.

DataStreamError getLastError()

Gets the last error which occurred while parsing the data stream.

Returns:

Returns the last error, OK in case there occurred no error

bool getBlobStartTcp(std::vector<std::uint8_t> &receiveBufferPacketSize)