Classes | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
NetworkDepthSensor Class Reference

#include <network_depth_sensor.h>

Inheritance diagram for NetworkDepthSensor:
Inheritance graph
[legend]

Classes

struct  ImplData
 

Public Member Functions

virtual aditof::Status adsd3500_get_status (int &chipStatus, int &imagerStatus) override
 Returns the chip status. More...
 
virtual aditof::Status adsd3500_read_cmd (uint16_t cmd, uint16_t *data, unsigned int usDelay=0) override
 Send a read command to adsd3500. More...
 
virtual aditof::Status adsd3500_read_payload (uint8_t *payload, uint16_t payload_len) override
 Reads a chunk of data from adsd3500. This will perform a burst read making it useful for reading chunks of data. More...
 
virtual aditof::Status adsd3500_read_payload_cmd (uint32_t cmd, uint8_t *readback_data, uint16_t payload_len) override
 Send a read command to adsd3500. This will perform a burst read making it useful for reading chunks of data. More...
 
virtual aditof::Status adsd3500_register_interrupt_callback (aditof::SensorInterruptCallback &cb) override
 Register a function to be called when a ADSD3500 interrupt occurs. More...
 
virtual aditof::Status adsd3500_reset () override
 Reset adsd3500 chip. More...
 
virtual aditof::Status adsd3500_unregister_interrupt_callback (aditof::SensorInterruptCallback &cb) override
 Unregister a function registered with adsd3500_register_interrupt_callback. More...
 
virtual aditof::Status adsd3500_write_cmd (uint16_t cmd, uint16_t data, unsigned int usDelay=0) override
 Send a write command to adsd3500. More...
 
virtual aditof::Status adsd3500_write_payload (uint8_t *payload, uint16_t payload_len) override
 Send a chunk of data (payload) to adsd3500. This will perform a burst write making it useful for writing chunks of data. More...
 
virtual aditof::Status adsd3500_write_payload_cmd (uint32_t cmd, uint8_t *payload, uint16_t payload_len) override
 Send a write command to adsd3500. This will perform a burst write making it useful for writing chunks of data. More...
 
virtual aditof::Status getAvailableControls (std::vector< std::string > &controls) const override
 Gets the sensors's list of controls. More...
 
virtual aditof::Status getAvailableModes (std::vector< uint8_t > &modes) override
 Return all modes that are supported by the sensor. More...
 
virtual aditof::Status getControl (const std::string &control, std::string &value) const override
 Gets the value of a specific sensor control. More...
 
virtual aditof::Status getDepthComputeParams (std::map< std::string, std::string > &params) override
 Get ini parameters for Depth Compute library. More...
 
virtual aditof::Status getDetails (aditof::SensorDetails &details) const override
 Get a structure that contains information about the instance of the sensor. More...
 
virtual aditof::Status getFrame (uint16_t *buffer) override
 Request a frame from the sensor. More...
 
virtual aditof::Status getHandle (void **handle) override
 Gets a handle to be used by other devices such as Storage, Temperature, etc. This handle will allow the other devices to communicate remotely with the embedded target. More...
 
aditof::Status getIniParamsArrayForMode (int mode, std::string &iniStr) override
 Get ini parameters for Depth Compute library as string. More...
 
virtual aditof::Status getModeDetails (const uint8_t &mode, aditof::DepthSensorModeDetails &details) override
 Returns details of specified mode. More...
 
virtual aditof::Status getName (std::string &name) const override
 Get the name of the sensor. More...
 
virtual aditof::Status initTargetDepthCompute (uint8_t *iniFile, uint16_t iniFileLength, uint8_t *calData, uint16_t calDataLength) override
 Get the name of the sensor. More...
 
 NetworkDepthSensor (const std::string &name, const std::string &ip)
 
virtual aditof::Status open () override
 Open the communication channels with the hardware. More...
 
virtual aditof::Status setControl (const std::string &control, const std::string &value) override
 Sets a specific sensor control. More...
 
virtual aditof::Status setDepthComputeParams (const std::map< std::string, std::string > &params) override
 Set ini parameters for Depth Compute library. More...
 
virtual aditof::Status setHostConnectionType (std::string &connectionType) override
 Set the host connection type for target sdk. More...
 
virtual aditof::Status setMode (const aditof::DepthSensorModeDetails &type) override
 Set the sensor frame mode to the given type. More...
 
virtual aditof::Status setMode (const uint8_t &mode) override
 Set the sensor frame mode to the given type. More...
 
aditof::Status setSensorConfiguration (const std::string &sensorConf) override
 Set sensor configutation table. More...
 
virtual aditof::Status start () override
 Start the streaming of data from the sensor. More...
 
virtual aditof::Status stop () override
 Stop the sensor data stream. More...
 
 ~NetworkDepthSensor ()
 
- Public Member Functions inherited from aditof::DepthSensorInterface
virtual ~DepthSensorInterface ()=default
 Destructor. More...
 

Private Member Functions

void checkForServerUpdates ()
 

Private Attributes

std::thread m_activityCheckThread
 
std::unique_ptr< ImplDatam_implData
 
std::unordered_map< void *, aditof::SensorInterruptCallbackm_interruptCallbackMap
 
aditof::SensorDetails m_sensorDetails
 
int m_sensorIndex
 
std::string m_sensorName
 
bool m_stopServerCheck
 

Static Private Attributes

static int frame_size = 0
 
static int m_sensorCounter
 

Detailed Description

Definition at line 41 of file network_depth_sensor.h.

Constructor & Destructor Documentation

◆ NetworkDepthSensor()

NetworkDepthSensor::NetworkDepthSensor ( const std::string name,
const std::string ip 
)

Definition at line 60 of file network_depth_sensor.cpp.

◆ ~NetworkDepthSensor()

NetworkDepthSensor::~NetworkDepthSensor ( )

Definition at line 124 of file network_depth_sensor.cpp.

Member Function Documentation

◆ adsd3500_get_status()

aditof::Status NetworkDepthSensor::adsd3500_get_status ( int &  chipStatus,
int &  imagerStatus 
)
overridevirtual

Returns the chip status.

Parameters
[out]chipStatus- chip status (error) value
[out]imagerStatus- imager status (error) value
Returns
Status

Implements aditof::DepthSensorInterface.

Definition at line 1170 of file network_depth_sensor.cpp.

◆ adsd3500_read_cmd()

aditof::Status NetworkDepthSensor::adsd3500_read_cmd ( uint16_t  cmd,
uint16_t *  data,
unsigned int  usDelay = 0 
)
overridevirtual

Send a read command to adsd3500.

Parameters
cmd- the command to be sent
[out]data- the variable where the read data will be stored
usDelay- the number of microseconds to wait between the host command and the actual read
Returns
Status

Implements aditof::DepthSensorInterface.

Definition at line 859 of file network_depth_sensor.cpp.

◆ adsd3500_read_payload()

aditof::Status NetworkDepthSensor::adsd3500_read_payload ( uint8_t *  payload,
uint16_t  payload_len 
)
overridevirtual

Reads a chunk of data from adsd3500. This will perform a burst read making it useful for reading chunks of data.

Parameters
payload- the location from where to take the data chunk and read it
payload_len- the number of bytes to read
Returns
Status

Implements aditof::DepthSensorInterface.

Definition at line 996 of file network_depth_sensor.cpp.

◆ adsd3500_read_payload_cmd()

aditof::Status NetworkDepthSensor::adsd3500_read_payload_cmd ( uint32_t  cmd,
uint8_t *  readback_data,
uint16_t  payload_len 
)
overridevirtual

Send a read command to adsd3500. This will perform a burst read making it useful for reading chunks of data.

Parameters
cmd- the command to be sent
[out]readback_data- the location where the read data chunk will be stored
payload_len- the number of bytes to read
Returns
Status

Implements aditof::DepthSensorInterface.

Definition at line 948 of file network_depth_sensor.cpp.

◆ adsd3500_register_interrupt_callback()

aditof::Status NetworkDepthSensor::adsd3500_register_interrupt_callback ( aditof::SensorInterruptCallback cb)
overridevirtual

Register a function to be called when a ADSD3500 interrupt occurs.

Parameters
cb- the function to be called whenever the interrupt occurs
Returns
Status

Implements aditof::DepthSensorInterface.

Definition at line 1156 of file network_depth_sensor.cpp.

◆ adsd3500_reset()

aditof::Status NetworkDepthSensor::adsd3500_reset ( )
overridevirtual

Reset adsd3500 chip.

Returns
Status

Implements aditof::DepthSensorInterface.

Definition at line 1121 of file network_depth_sensor.cpp.

◆ adsd3500_unregister_interrupt_callback()

aditof::Status NetworkDepthSensor::adsd3500_unregister_interrupt_callback ( aditof::SensorInterruptCallback cb)
overridevirtual

Unregister a function registered with adsd3500_register_interrupt_callback.

Parameters
cb- the function to be unregistred
Returns
Status

Implements aditof::DepthSensorInterface.

Definition at line 1162 of file network_depth_sensor.cpp.

◆ adsd3500_write_cmd()

aditof::Status NetworkDepthSensor::adsd3500_write_cmd ( uint16_t  cmd,
uint16_t  data,
unsigned int  usDelay = 0 
)
overridevirtual

Send a write command to adsd3500.

Parameters
cmd- the command to be sent
data- the data to be written
usDelay- the number of microseconds to wait between the host command and the actual write
Returns
Status

Implements aditof::DepthSensorInterface.

Definition at line 905 of file network_depth_sensor.cpp.

◆ adsd3500_write_payload()

aditof::Status NetworkDepthSensor::adsd3500_write_payload ( uint8_t *  payload,
uint16_t  payload_len 
)
overridevirtual

Send a chunk of data (payload) to adsd3500. This will perform a burst write making it useful for writing chunks of data.

Parameters
payload- the location from where to take the data chunk and write it
payload_len- the number of bytes to write
Returns
Status

Implements aditof::DepthSensorInterface.

Definition at line 1082 of file network_depth_sensor.cpp.

◆ adsd3500_write_payload_cmd()

aditof::Status NetworkDepthSensor::adsd3500_write_payload_cmd ( uint32_t  cmd,
uint8_t *  payload,
uint16_t  payload_len 
)
overridevirtual

Send a write command to adsd3500. This will perform a burst write making it useful for writing chunks of data.

Parameters
cmd- the command to be sent
payload- the location from where to take the data chunk and write it
payload_len- the number of bytes to write
Returns
Status

Implements aditof::DepthSensorInterface.

Definition at line 1040 of file network_depth_sensor.cpp.

◆ checkForServerUpdates()

void NetworkDepthSensor::checkForServerUpdates ( )
private

Definition at line 1252 of file network_depth_sensor.cpp.

◆ getAvailableControls()

aditof::Status NetworkDepthSensor::getAvailableControls ( std::vector< std::string > &  controls) const
overridevirtual

Gets the sensors's list of controls.

Parameters
[out]controls
Returns
Status

Implements aditof::DepthSensorInterface.

Definition at line 704 of file network_depth_sensor.cpp.

◆ getAvailableModes()

aditof::Status NetworkDepthSensor::getAvailableModes ( std::vector< uint8_t > &  modes)
overridevirtual

Return all modes that are supported by the sensor.

Parameters
[out]modes
Returns
Status

Implements aditof::DepthSensorInterface.

Definition at line 426 of file network_depth_sensor.cpp.

◆ getControl()

aditof::Status NetworkDepthSensor::getControl ( const std::string control,
std::string value 
) const
overridevirtual

Gets the value of a specific sensor control.

Parameters
[in]control- Control name
[out]value- Control value
Returns
Status

Implements aditof::DepthSensorInterface.

Definition at line 789 of file network_depth_sensor.cpp.

◆ getDepthComputeParams()

aditof::Status NetworkDepthSensor::getDepthComputeParams ( std::map< std::string, std::string > &  params)
overridevirtual

Get ini parameters for Depth Compute library.

Parameters
[in]params- a dictionary of parameters
Returns
Status

Implements aditof::DepthSensorInterface.

Definition at line 157 of file network_depth_sensor.cpp.

◆ getDetails()

aditof::Status NetworkDepthSensor::getDetails ( aditof::SensorDetails details) const
overridevirtual

Get a structure that contains information about the instance of the sensor.

Parameters
[out]details- the variable where the sensor details should be stored
Returns
Status

Implements aditof::DepthSensorInterface.

Definition at line 831 of file network_depth_sensor.cpp.

◆ getFrame()

aditof::Status NetworkDepthSensor::getFrame ( uint16_t *  buffer)
overridevirtual

Request a frame from the sensor.

Parameters
buffer- a valid location where the new frame should be stored. The size of the frame is known (cached) internally and gets updated each time setMode() is called.
Returns
Status

Implements aditof::DepthSensorInterface.

Definition at line 649 of file network_depth_sensor.cpp.

◆ getHandle()

aditof::Status NetworkDepthSensor::getHandle ( void **  handle)
overridevirtual

Gets a handle to be used by other devices such as Storage, Temperature, etc. This handle will allow the other devices to communicate remotely with the embedded target.

Parameters
[out]handle- the handle which is owned by this instance
Returns
Status

Implements aditof::DepthSensorInterface.

Definition at line 836 of file network_depth_sensor.cpp.

◆ getIniParamsArrayForMode()

aditof::Status NetworkDepthSensor::getIniParamsArrayForMode ( int  mode,
std::string iniStr 
)
overridevirtual

Get ini parameters for Depth Compute library as string.

Parameters
[in]mode- desired mode
[out]iniStr- a string that contain ini params
Returns
Status

Implements aditof::DepthSensorInterface.

Definition at line 1320 of file network_depth_sensor.cpp.

◆ getModeDetails()

aditof::Status NetworkDepthSensor::getModeDetails ( const uint8_t &  mode,
aditof::DepthSensorModeDetails details 
)
overridevirtual

Returns details of specified mode.

Parameters
mode
[out]details
Returns
Status

Implements aditof::DepthSensorInterface.

Definition at line 472 of file network_depth_sensor.cpp.

◆ getName()

aditof::Status NetworkDepthSensor::getName ( std::string name) const
overridevirtual

Get the name of the sensor.

Parameters
[out]name- the string in which the name is stored
Returns
Status

Implements aditof::DepthSensorInterface.

Definition at line 848 of file network_depth_sensor.cpp.

◆ initTargetDepthCompute()

aditof::Status NetworkDepthSensor::initTargetDepthCompute ( uint8_t *  iniFile,
uint16_t  iniFileLength,
uint8_t *  calData,
uint16_t  calDataLength 
)
overridevirtual

Get the name of the sensor.

Parameters
[in]iniFile- iniFile content parsed as uint8_t*
[in]iniFileLength- iniFile content length
[in]calData- calibration data parsed as uint8_t*
[in]calDataLength- calibration data content length
Returns
Status

Implements aditof::DepthSensorInterface.

Definition at line 1209 of file network_depth_sensor.cpp.

◆ open()

aditof::Status NetworkDepthSensor::open ( )
overridevirtual

Open the communication channels with the hardware.

Returns
Status

Implements aditof::DepthSensorInterface.

Definition at line 275 of file network_depth_sensor.cpp.

◆ setControl()

aditof::Status NetworkDepthSensor::setControl ( const std::string control,
const std::string value 
)
overridevirtual

Sets a specific sensor control.

Parameters
[in]control- Control name
[in]value- Control value
Returns
Status

Implements aditof::DepthSensorInterface.

Definition at line 751 of file network_depth_sensor.cpp.

◆ setDepthComputeParams()

aditof::Status NetworkDepthSensor::setDepthComputeParams ( const std::map< std::string, std::string > &  params)
overridevirtual

Set ini parameters for Depth Compute library.

Parameters
[in]params- a dictionary of parameters
Returns
Status

Implements aditof::DepthSensorInterface.

Definition at line 219 of file network_depth_sensor.cpp.

◆ setHostConnectionType()

aditof::Status NetworkDepthSensor::setHostConnectionType ( std::string connectionType)
overridevirtual

Set the host connection type for target sdk.

Parameters
[in]connectionType- the string that sets the host type on the target
Returns
Status

Implements aditof::DepthSensorInterface.

Definition at line 854 of file network_depth_sensor.cpp.

◆ setMode() [1/2]

aditof::Status NetworkDepthSensor::setMode ( const aditof::DepthSensorModeDetails type)
overridevirtual

Set the sensor frame mode to the given type.

Parameters
type- frame details structure containing the frame type
Returns
Status

Implements aditof::DepthSensorInterface.

Definition at line 581 of file network_depth_sensor.cpp.

◆ setMode() [2/2]

aditof::Status NetworkDepthSensor::setMode ( const uint8_t &  mode)
overridevirtual

Set the sensor frame mode to the given type.

Parameters
mode- desired mode
Returns
Status

Implements aditof::DepthSensorInterface.

Definition at line 544 of file network_depth_sensor.cpp.

◆ setSensorConfiguration()

aditof::Status NetworkDepthSensor::setSensorConfiguration ( const std::string sensorConf)
overridevirtual

Set sensor configutation table.

Parameters
sensorConf- Configuration table name string like e.g. standard, standardraw, custom and customraw
Returns
Status

Implements aditof::DepthSensorInterface.

Definition at line 1283 of file network_depth_sensor.cpp.

◆ start()

aditof::Status NetworkDepthSensor::start ( )
overridevirtual

Start the streaming of data from the sensor.

Returns
Status

Implements aditof::DepthSensorInterface.

Definition at line 323 of file network_depth_sensor.cpp.

◆ stop()

aditof::Status NetworkDepthSensor::stop ( )
overridevirtual

Stop the sensor data stream.

Returns
Status

Implements aditof::DepthSensorInterface.

Definition at line 385 of file network_depth_sensor.cpp.

Member Data Documentation

◆ frame_size

int NetworkDepthSensor::frame_size = 0
staticprivate

Definition at line 123 of file network_depth_sensor.h.

◆ m_activityCheckThread

std::thread NetworkDepthSensor::m_activityCheckThread
private

Definition at line 121 of file network_depth_sensor.h.

◆ m_implData

std::unique_ptr<ImplData> NetworkDepthSensor::m_implData
private

Definition at line 115 of file network_depth_sensor.h.

◆ m_interruptCallbackMap

std::unordered_map<void *, aditof::SensorInterruptCallback> NetworkDepthSensor::m_interruptCallbackMap
private

Definition at line 119 of file network_depth_sensor.h.

◆ m_sensorCounter

int NetworkDepthSensor::m_sensorCounter
staticprivate

Definition at line 117 of file network_depth_sensor.h.

◆ m_sensorDetails

aditof::SensorDetails NetworkDepthSensor::m_sensorDetails
private

Definition at line 114 of file network_depth_sensor.h.

◆ m_sensorIndex

int NetworkDepthSensor::m_sensorIndex
private

Definition at line 116 of file network_depth_sensor.h.

◆ m_sensorName

std::string NetworkDepthSensor::m_sensorName
private

Definition at line 112 of file network_depth_sensor.h.

◆ m_stopServerCheck

bool NetworkDepthSensor::m_stopServerCheck
private

Definition at line 120 of file network_depth_sensor.h.


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


libaditof
Author(s):
autogenerated on Wed May 21 2025 02:07:06