CVB++ 15.0
DeviceControl Class Reference

Implementation of the device control interface. More...

#include <cvb/driver/device_control.hpp>

Public Member Functions

DevicePtr Parent () const noexcept
 Gets the parent device of this interface. More...
 
String SendStringCommand (DeviceControlCommand command, const String &value)
 Sends the given command value to the driver. More...
 
template<class IN_TYPE , class OUT_TYPE >
void SendCommand (DeviceControlCommand command, IN_TYPE value, OUT_TYPE &result)
 Sends the given command value to the driver. More...
 
template<class OUT_TYPE >
void SendCommand (DeviceControlCommand command, OUT_TYPE &result)
 Sends the given command value to the driver. More...
 
void SendCommand (DeviceControlCommand command, void *inputBuffer, std::size_t inputBufferSize, void *outputBuffer, std::size_t &outputBufferSize)
 Sends the given command value to the driver. More...
 

Detailed Description

Implementation of the device control interface.

Member Function Documentation

◆ Parent()

DevicePtr Parent ( ) const
inlinenoexcept

Gets the parent device of this interface.

Returns
The parent device pointer, or a null pointer if disconnected.
Exceptions
Doesnot throw any exception.

◆ SendCommand() [1/3]

void SendCommand ( DeviceControlCommand  command,
IN_TYPE  value,
OUT_TYPE &  result 
)
inline

Sends the given command value to the driver.

Parameters
[in]commandCommand to execute.
[in]valueValue to send.
[in]resultCommand answer.
Exceptions
Anyexception derived from std::exception including CvbException.

This method can handle custom, types.

◆ SendCommand() [2/3]

void SendCommand ( DeviceControlCommand  command,
OUT_TYPE &  result 
)
inline

Sends the given command value to the driver.

Parameters
[in]commandCommand to execute.
[in]resultCommand answer.
Exceptions
Anyexception derived from std::exception including CvbException.

This method can handle custom, types.

◆ SendCommand() [3/3]

void SendCommand ( DeviceControlCommand  command,
void *  inputBuffer,
std::size_t  inputBufferSize,
void *  outputBuffer,
std::size_t outputBufferSize 
)
inline

Sends the given command value to the driver.

Parameters
[in]commandCommand to execute.
[in]inputBufferPointer to input buffer to send.
[in]inputBufferSizeSize of the input buffer data.
[in]outputBufferPointer to buffer to received command data.
[in]outputBufferSizeSize of the output buffer if not zero, will receive the minimal necessary size otherwise.
Exceptions
Anyexception derived from std::exception including CvbException.

This method can only handle raw data. All sizes are given in byte.

◆ SendStringCommand()

String SendStringCommand ( DeviceControlCommand  command,
const String value 
)
inline

Sends the given command value to the driver.

Parameters
[in]commandCommand to execute.
[in]valueString value to send.
Returns
The commands result as string.
Exceptions
Anyexception derived from std::exception including CvbException.