libvisiontransfer  6.4.0
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
visiontransfer::internal::ParameterTransfer Class Reference

Allows a configuration of device parameters over the network. More...

#include <visiontransfer/parametertransfer.h>

Public Member Functions

 ParameterTransfer (const char *address, const char *service="7683")
 Creates an object and connects to the given server. More...
 
int readIntParameter (int32_t id)
 Reads an integer value from the parameter server. More...
 
double readDoubleParameter (int32_t id)
 Reads a double precision floating point value from the parameter server. More...
 
bool readBoolParameter (int32_t id)
 Reads a boolean value from the parameter server. More...
 
void writeIntParameter (int32_t id, int32_t value)
 Writes an integer value to a parameter of the parameter server. More...
 
void writeDoubleParameter (int32_t id, double value)
 Writes a double precision floating point value to a parameter of the parameter server. More...
 
void writeBoolParameter (int32_t id, int32_t value)
 Writes a boolean value to a parameter of the parameter server. More...
 
void checkProtocolVersion ()
 
void readParameter (unsigned char messageType, int32_t id, unsigned char *dest, int length)
 
void recvData (unsigned char *dest, int length)
 
template<typename T >
void writeParameter (unsigned char messageType, int32_t id, T value)
 

Public Attributes

SOCKET socket
 

Static Public Attributes

static constexpr int SOCKET_TIMEOUT_MS = 500
 
static constexpr unsigned char MESSAGE_READ_INT = 0x01
 
static constexpr unsigned char MESSAGE_READ_DOUBLE = 0x02
 
static constexpr unsigned char MESSAGE_READ_BOOL = 0x03
 
static constexpr unsigned char MESSAGE_WRITE_INT = 0x04
 
static constexpr unsigned char MESSAGE_WRITE_DOUBLE = 0x05
 
static constexpr unsigned char MESSAGE_WRITE_BOOL = 0x06
 

Detailed Description

Allows a configuration of device parameters over the network.

A TCP connection is established to a parameter server. The protocol allows writing and reading of individual parameters, which are identified by a unique ID. There are three supported types of parameters: integers, double precision floating point values, and booleans.

This class is only used internally. Users should use the class SceneScanParameters instead.

Definition at line 36 of file parametertransfer.h.

Constructor & Destructor Documentation

◆ ParameterTransfer()

ParameterTransfer::ParameterTransfer ( const char *  address,
const char *  service = "7683" 
)

Creates an object and connects to the given server.

Parameters
addressIP address or host name of the server.
serviceThe port number that should be used as string or as textual service name.

Definition at line 28 of file parametertransfer.cpp.

Member Function Documentation

◆ readBoolParameter()

bool ParameterTransfer::readBoolParameter ( int32_t  id)

Reads a boolean value from the parameter server.

Parameters
idUnique ID of the parameter to be read.
Returns
If successful, the value of the parameter that has been read

If reading the parameter fails, then an exception of type TransferException or ParameterException is thrown.

Definition at line 129 of file parametertransfer.cpp.

◆ readDoubleParameter()

double ParameterTransfer::readDoubleParameter ( int32_t  id)

Reads a double precision floating point value from the parameter server.

Parameters
idUnique ID of the parameter to be read.
Returns
If successful, the value of the parameter that has been read

If reading the parameter fails, then an exception of type TransferException or ParameterException is thrown.

Definition at line 123 of file parametertransfer.cpp.

◆ readIntParameter()

int ParameterTransfer::readIntParameter ( int32_t  id)

Reads an integer value from the parameter server.

Parameters
idUnique ID of the parameter to be read.
Returns
If successful, the value of the parameter that has been read

If reading the parameter fails, then an exception of type TransferException or ParameterException is thrown.

Definition at line 117 of file parametertransfer.cpp.

◆ writeBoolParameter()

void ParameterTransfer::writeBoolParameter ( int32_t  id,
int32_t  value 
)

Writes a boolean value to a parameter of the parameter server.

Parameters
idUnique ID of the parameter to be written.
valueValue that should be written to the parameter.

If writing the parameter fails, then an exception of type TransferException or ParameterException is thrown.

Definition at line 143 of file parametertransfer.cpp.

◆ writeDoubleParameter()

void ParameterTransfer::writeDoubleParameter ( int32_t  id,
double  value 
)

Writes a double precision floating point value to a parameter of the parameter server.

Parameters
idUnique ID of the parameter to be written.
valueValue that should be written to the parameter.

If writing the parameter fails, then an exception of type TransferException or ParameterException is thrown.

Definition at line 139 of file parametertransfer.cpp.

◆ writeIntParameter()

void ParameterTransfer::writeIntParameter ( int32_t  id,
int32_t  value 
)

Writes an integer value to a parameter of the parameter server.

Parameters
idUnique ID of the parameter to be written.
valueValue that should be written to the parameter.

If writing the parameter fails, then an exception of type TransferException or ParameterException is thrown.

Definition at line 135 of file parametertransfer.cpp.


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