15 #ifndef VISIONTRANSFER_PARAMETERTRANSFER_H 16 #define VISIONTRANSFER_PARAMETERTRANSFER_H 18 #include "visiontransfer/networking.h" 19 #include "visiontransfer/parameterinfo.h" 130 static constexpr
int SOCKET_TIMEOUT_MS = 500;
133 static constexpr
unsigned char MESSAGE_READ_INT = 0x01;
134 static constexpr
unsigned char MESSAGE_READ_DOUBLE = 0x02;
135 static constexpr
unsigned char MESSAGE_READ_BOOL = 0x03;
136 static constexpr
unsigned char MESSAGE_WRITE_INT = 0x04;
137 static constexpr
unsigned char MESSAGE_WRITE_DOUBLE = 0x05;
138 static constexpr
unsigned char MESSAGE_WRITE_BOOL = 0x06;
139 static constexpr
unsigned char MESSAGE_ENUMERATE_PARAMS = 0x07;
143 void checkProtocolVersion();
144 void readParameter(
unsigned char messageType, int32_t
id,
unsigned char* dest,
int length);
145 void recvData(
unsigned char* dest,
int length);
148 void writeParameter(
unsigned char messageType, int32_t
id, T value);
150 std::map<std::string, ParameterInfo> recvEnumeration();
bool readBoolParameter(int32_t id)
Reads a boolean value from the parameter server.
int readIntParameter(int32_t id)
Reads an integer value from the parameter server.
Allows a configuration of device parameters over the network.
void writeBoolParameter(int32_t id, int32_t value)
Writes a boolean value to a parameter of the parameter server.
void writeIntParameter(int32_t id, int32_t value)
Writes an integer value to a parameter of the parameter server.
void writeDoubleParameter(int32_t id, double value)
Writes a double precision floating point value to a parameter of the parameter server.
ParameterTransfer(const char *address, const char *service="7683")
Creates an object and connects to the given server.
std::map< std::string, ParameterInfo > getAllParameters()
Enumerates all parameters as reported by the device.
double readDoubleParameter(int32_t id)
Reads a double precision floating point value from the parameter server.