Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
librealsense::hid_sensor Class Reference

#include <sensor.h>

Inheritance diagram for librealsense::hid_sensor:
Inheritance graph
[legend]

Public Member Functions

void close () override
 
std::vector< uint8_tget_custom_report_data (const std::string &custom_sensor_name, const std::string &report_name, platform::custom_sensor_report_field report_field) const
 
 hid_sensor (std::shared_ptr< platform::hid_device > hid_device, std::unique_ptr< frame_timestamp_reader > hid_iio_timestamp_reader, std::unique_ptr< frame_timestamp_reader > custom_hid_timestamp_reader, const std::map< rs2_stream, std::map< unsigned, unsigned >> &fps_and_sampling_frequency_per_rs2_stream, const std::vector< std::pair< std::string, stream_profile >> &sensor_name_and_hid_profiles, device *dev)
 
void open (const stream_profiles &requests) override
 
void start (frame_callback_ptr callback) override
 
void stop () override
 
 ~hid_sensor () override
 
- Public Member Functions inherited from librealsense::sensor_base
rs2_format fourcc_to_rs2_format (uint32_t format) const
 
rs2_stream fourcc_to_rs2_stream (uint32_t fourcc_format) const
 
stream_profiles get_active_streams () const override
 
device_interfaceget_device () override
 
std::shared_ptr< std::map< uint32_t, rs2_format > > & get_fourcc_to_rs2_format_map ()
 
std::shared_ptr< std::map< uint32_t, rs2_stream > > & get_fourcc_to_rs2_stream_map ()
 
virtual frame_callback_ptr get_frames_callback () const override
 
const std::stringget_info (rs2_camera_info info) const override
 
notifications_callback_ptr get_notifications_callback () const override
 
virtual std::shared_ptr< notifications_processorget_notifications_processor () const
 
processing_blocks get_recommended_processing_blocks () const override
 
stream_profiles get_stream_profiles (int tag=profile_tag::PROFILE_TAG_ANY) const override
 
virtual bool is_opened () const
 
bool is_streaming () const override
 
int register_before_streaming_changes_callback (std::function< void(bool)> callback) override
 
virtual void register_metadata (rs2_frame_metadata_value metadata, std::shared_ptr< md_attribute_parser_base > metadata_parser) const
 
void register_notifications_callback (notifications_callback_ptr callback) override
 
void register_on_open (on_open callback)
 
 sensor_base (std::string name, device *device, recommended_proccesing_blocks_interface *owner)
 
virtual void set_frames_callback (frame_callback_ptr callback) override
 
void set_source_owner (sensor_base *owner)
 
bool supports_info (rs2_camera_info info) const override
 
void unregister_before_start_callback (int token) override
 
virtual ~sensor_base () override
 
- Public Member Functions inherited from librealsense::sensor_interface
virtual ~sensor_interface ()=default
 
- Public Member Functions inherited from librealsense::info_interface
virtual ~info_interface ()=default
 
- Public Member Functions inherited from librealsense::recordable< info_interface >
virtual ~recordable ()=default
 
- Public Member Functions inherited from librealsense::options_interface
virtual ~options_interface ()=default
 
- Public Member Functions inherited from librealsense::recordable< options_interface >
virtual ~recordable ()=default
 
- Public Member Functions inherited from librealsense::recommended_proccesing_blocks_interface
virtual ~recommended_proccesing_blocks_interface ()=default
 
- Public Member Functions inherited from librealsense::options_container
void create_snapshot (std::shared_ptr< options_interface > &snapshot) const override
 
void enable_recording (std::function< void(const options_interface &)> record_action) override
 
optionget_option (rs2_option id) override
 
const optionget_option (rs2_option id) const override
 
std::shared_ptr< optionget_option_handler (rs2_option id)
 
std::shared_ptr< optionget_option_handler (rs2_option id) const
 
virtual const char * get_option_name (rs2_option option) const override
 
std::vector< rs2_optionget_supported_options () const override
 
void register_option (rs2_option id, std::shared_ptr< option > option)
 
bool supports_option (rs2_option id) const override
 
void unregister_option (rs2_option id)
 
void update (std::shared_ptr< extension_snapshot > ext) override
 
- Public Member Functions inherited from librealsense::extension_snapshot
virtual ~extension_snapshot ()=default
 
- Public Member Functions inherited from librealsense::info_container
void create_snapshot (std::shared_ptr< info_interface > &snapshot) const override
 
void enable_recording (std::function< void(const info_interface &)> record_action) override
 
void register_info (rs2_camera_info info, const std::string &val)
 
void update (std::shared_ptr< extension_snapshot > ext) override
 
void update_info (rs2_camera_info info, const std::string &val)
 
- Public Member Functions inherited from librealsense::recommended_proccesing_blocks_base
virtual void create_snapshot (std::shared_ptr< recommended_proccesing_blocks_interface > &snapshot) const override
 
virtual void enable_recording (std::function< void(const recommended_proccesing_blocks_interface &)> recording_function) override
 
 recommended_proccesing_blocks_base (recommended_proccesing_blocks_interface *owner)
 
- Public Member Functions inherited from librealsense::recordable< recommended_proccesing_blocks_interface >
virtual ~recordable ()=default
 

Protected Member Functions

stream_profiles init_stream_profiles () override
 
- Protected Member Functions inherited from librealsense::sensor_base
void assign_stream (const std::shared_ptr< stream_interface > &stream, std::shared_ptr< stream_profile_interface > target) const
 
std::shared_ptr< framegenerate_frame_from_data (const platform::frame_object &fo, frame_timestamp_reader *timestamp_reader, const rs2_time_t &last_timestamp, const unsigned long long &last_frame_number, std::shared_ptr< stream_profile_interface > profile)
 
void raise_on_before_streaming_changes (bool streaming)
 
void set_active_streams (const stream_profiles &requests)
 

Private Member Functions

uint32_t fps_to_sampling_frequency (rs2_stream stream, uint32_t fps) const
 
stream_profiles get_sensor_profiles (std::string sensor_name) const
 
const std::stringrs2_stream_to_sensor_name (rs2_stream stream) const
 
uint32_t stream_to_fourcc (rs2_stream stream) const
 

Private Attributes

std::mutex _configure_lock
 
std::map< std::string, std::shared_ptr< stream_profile_interface > > _configured_profiles
 
std::unique_ptr< frame_timestamp_reader_custom_hid_timestamp_reader
 
std::map< rs2_stream, std::map< uint32_t, uint32_t > > _fps_and_sampling_frequency_per_rs2_stream
 
std::shared_ptr< platform::hid_device_hid_device
 
std::unique_ptr< frame_timestamp_reader_hid_iio_timestamp_reader
 
std::vector< platform::hid_sensor_hid_sensors
 
std::vector< bool > _is_configured_stream
 
const std::vector< std::pair< std::string, stream_profile > > _sensor_name_and_hid_profiles
 
const std::map< rs2_stream, uint32_tstream_and_fourcc
 

Additional Inherited Members

- Protected Attributes inherited from librealsense::sensor_base
std::shared_ptr< std::map< uint32_t, rs2_format > > _fourcc_to_rs2_format
 
std::shared_ptr< std::map< uint32_t, rs2_stream > > _fourcc_to_rs2_stream
 
std::vector< platform::stream_profile_internal_config
 
std::atomic< bool > _is_opened
 
std::atomic< bool > _is_streaming
 
std::shared_ptr< metadata_parser_map_metadata_parsers = nullptr
 
std::shared_ptr< notifications_processor_notifications_processor
 
on_open _on_open
 
device_owner
 
frame_source _source
 
sensor_base_source_owner = nullptr
 
std::vector< platform::stream_profile_uvc_profiles
 
- Protected Attributes inherited from librealsense::options_container
std::map< rs2_option, std::shared_ptr< option > > _options
 
std::function< void(const options_interface &)> _recording_function = [](const options_interface&) {}
 

Detailed Description

Definition at line 275 of file sensor.h.

Constructor & Destructor Documentation

librealsense::hid_sensor::hid_sensor ( std::shared_ptr< platform::hid_device hid_device,
std::unique_ptr< frame_timestamp_reader hid_iio_timestamp_reader,
std::unique_ptr< frame_timestamp_reader custom_hid_timestamp_reader,
const std::map< rs2_stream, std::map< unsigned, unsigned >> &  fps_and_sampling_frequency_per_rs2_stream,
const std::vector< std::pair< std::string, stream_profile >> &  sensor_name_and_hid_profiles,
device dev 
)
explicit

Definition at line 662 of file sensor.cpp.

librealsense::hid_sensor::~hid_sensor ( )
override

Definition at line 689 of file sensor.cpp.

Member Function Documentation

void librealsense::hid_sensor::close ( )
overridevirtual

Implements librealsense::sensor_interface.

Definition at line 752 of file sensor.cpp.

uint32_t librealsense::hid_sensor::fps_to_sampling_frequency ( rs2_stream  stream,
uint32_t  fps 
) const
private

Definition at line 926 of file sensor.cpp.

std::vector< uint8_t > librealsense::hid_sensor::get_custom_report_data ( const std::string custom_sensor_name,
const std::string report_name,
platform::custom_sensor_report_field  report_field 
) const

Definition at line 884 of file sensor.cpp.

stream_profiles librealsense::hid_sensor::get_sensor_profiles ( std::string  sensor_name) const
private

Definition at line 705 of file sensor.cpp.

stream_profiles librealsense::hid_sensor::init_stream_profiles ( )
overrideprotectedvirtual

Implements librealsense::sensor_base.

Definition at line 890 of file sensor.cpp.

void librealsense::hid_sensor::open ( const stream_profiles requests)
overridevirtual

Implements librealsense::sensor_interface.

Definition at line 726 of file sensor.cpp.

const std::string & librealsense::hid_sensor::rs2_stream_to_sensor_name ( rs2_stream  stream) const
private

Definition at line 902 of file sensor.cpp.

void librealsense::hid_sensor::start ( frame_callback_ptr  callback)
overridevirtual

Implements librealsense::sensor_interface.

Definition at line 786 of file sensor.cpp.

void librealsense::hid_sensor::stop ( )
overridevirtual

Implements librealsense::sensor_interface.

Definition at line 868 of file sensor.cpp.

uint32_t librealsense::hid_sensor::stream_to_fourcc ( rs2_stream  stream) const
private

Definition at line 912 of file sensor.cpp.

Member Data Documentation

std::mutex librealsense::hid_sensor::_configure_lock
private

Definition at line 307 of file sensor.h.

std::map<std::string, std::shared_ptr<stream_profile_interface> > librealsense::hid_sensor::_configured_profiles
private

Definition at line 308 of file sensor.h.

std::unique_ptr<frame_timestamp_reader> librealsense::hid_sensor::_custom_hid_timestamp_reader
private

Definition at line 312 of file sensor.h.

std::map<rs2_stream, std::map<uint32_t, uint32_t> > librealsense::hid_sensor::_fps_and_sampling_frequency_per_rs2_stream
private

Definition at line 305 of file sensor.h.

std::shared_ptr<platform::hid_device> librealsense::hid_sensor::_hid_device
private

Definition at line 306 of file sensor.h.

std::unique_ptr<frame_timestamp_reader> librealsense::hid_sensor::_hid_iio_timestamp_reader
private

Definition at line 311 of file sensor.h.

std::vector<platform::hid_sensor> librealsense::hid_sensor::_hid_sensors
private

Definition at line 310 of file sensor.h.

std::vector<bool> librealsense::hid_sensor::_is_configured_stream
private

Definition at line 309 of file sensor.h.

const std::vector<std::pair<std::string, stream_profile> > librealsense::hid_sensor::_sensor_name_and_hid_profiles
private

Definition at line 304 of file sensor.h.

const std::map<rs2_stream, uint32_t> librealsense::hid_sensor::stream_and_fourcc
private
Initial value:
= {{RS2_STREAM_GYRO, rs_fourcc('G','Y','R','O')},
{RS2_STREAM_ACCEL, rs_fourcc('A','C','C','L')},
{RS2_STREAM_GPIO, rs_fourcc('G','P','I','O')}}

Definition at line 300 of file sensor.h.


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


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:50:37