VitroIO SDK
Software development kit for Vitro Shard.
Loading...
Searching...
No Matches
vitroio::sdk::AbstractSensorDriver Class Referenceabstract

Virtual class providing interface for sensor drivers. More...

#include <abstract_sensor_driver.h>

Public Member Functions

 AbstractSensorDriver ()
 
virtual ~AbstractSensorDriver ()
 
virtual int open ()=0
 Function initializes the sensor. More...
 
virtual void close ()=0
 Function deinitializes the sensor. More...
 
virtual int read (char *buffer, uint32_t address, uint32_t bytes)=0
 Function allows to read specified amount of data from provided address. More...
 
virtual int write (const char *buffer, uint32_t address, uint32_t bytes)=0
 Function allows to write specified amount of data to provided address. More...
 
virtual int ioctl (int request, void *value)=0
 Function allows to perform sensor specific operation. More...
 

Detailed Description

Virtual class providing interface for sensor drivers.

The aim of this class is to provide interface for basic communication with sensor i.e. initialization, deinitialization, reading, writing and optionally performing sensor specific operations.

Constructor & Destructor Documentation

◆ AbstractSensorDriver()

vitroio::sdk::AbstractSensorDriver::AbstractSensorDriver ( )
inline

◆ ~AbstractSensorDriver()

virtual vitroio::sdk::AbstractSensorDriver::~AbstractSensorDriver ( )
inlinevirtual

Member Function Documentation

◆ close()

virtual void vitroio::sdk::AbstractSensorDriver::close ( )
pure virtual

Function deinitializes the sensor.

◆ ioctl()

virtual int vitroio::sdk::AbstractSensorDriver::ioctl ( int  request,
void *  value 
)
pure virtual

Function allows to perform sensor specific operation.

Parameters
requestType of operation to perform.
valueOperation parameters.
Returns
Function returns 0 on success or appropriate error code otherwise.

◆ open()

virtual int vitroio::sdk::AbstractSensorDriver::open ( )
pure virtual

Function initializes the sensor.

Returns
Function returns 0 on success or appropriate error code otherwise.

◆ read()

virtual int vitroio::sdk::AbstractSensorDriver::read ( char *  buffer,
uint32_t  address,
uint32_t  bytes 
)
pure virtual

Function allows to read specified amount of data from provided address.

Parameters
bufferBuffer to which the data will be read.
addressAddress from which the data will be read.
bytesNumber of bytes to read.
Returns
Function returns 0 on success or appropriate error code otherwise.

◆ write()

virtual int vitroio::sdk::AbstractSensorDriver::write ( const char *  buffer,
uint32_t  address,
uint32_t  bytes 
)
pure virtual

Function allows to write specified amount of data to provided address.

Parameters
bufferBuffer with data which will be wrote.
addressAddress to which the data will be wrote.
bytesNumber of bytes to write.
Returns
Function returns 0 on success or appropriate error code otherwise.