4 #ifndef LIBREALSENSE_RS2_DEVICE_HPP 5 #define LIBREALSENSE_RS2_DEVICE_HPP 15 class pipeline_profile;
28 std::shared_ptr<rs2_sensor_list> list(
36 std::vector<sensor> results;
37 for (
auto i = 0; i < size; i++)
39 std::shared_ptr<rs2_sensor> dev(
45 results.push_back(rs2_dev);
56 if (
auto t = s.as<T>())
return t;
58 throw rs2::error(
"Could not find requested sensor type!");
71 return is_supported > 0;
112 operator bool()
const 114 return _dev !=
nullptr;
116 const std::shared_ptr<rs2_device>&
get()
const 143 std::shared_ptr<rs2_device>
_dev;
165 std::vector<uint8_t> results;
168 std::shared_ptr<const rs2_raw_data_buffer> list(
178 results.insert(results.begin(), start, start + size);
188 : _list(move(list)) {}
193 operator std::vector<device>()
const 195 std::vector<device> res;
196 for (
auto&& dev : *
this) res.push_back(dev);
217 std::shared_ptr<rs2_device> dev(
236 return std::move((*
this)[
size() - 1]);
252 return _list[_index];
256 return other._index != _index || &other._list != &_list;
260 return !(*
this != other);
287 std::shared_ptr<rs2_device_list> _list;
334 return is_enabled != 0;
360 #endif // LIBREALSENSE_RS2_DEVICE_HPP Definition: rs_types.hpp:69
device operator*() const
Definition: rs_device.hpp:250
device back() const
Definition: rs_device.hpp:234
int rs2_get_sensors_count(const rs2_sensor_list *info_list, rs2_error **error)
rs2_camera_info
Read-only strings that can be queried from the device. Not all information attributes are available o...
Definition: rs_sensor.h:22
Definition: rs_sensor.hpp:232
bool is() const
Definition: rs_device.hpp:122
int rs2_device_list_contains(const rs2_device_list *info_list, const rs2_device *device, rs2_error **error)
int rs2_loopback_is_enabled(const rs2_device *device, rs2_error **error)
device_list(std::shared_ptr< rs2_device_list > list)
Definition: rs_device.hpp:187
std::vector< uint8_t > send_and_receive_raw_data(const std::vector< uint8_t > &input) const
Definition: rs_device.hpp:163
std::vector< sensor > query_sensors() const
Definition: rs_device.hpp:25
device()
Definition: rs_device.hpp:110
const char * get_info(rs2_camera_info info) const
Definition: rs_device.hpp:79
device & operator=(const device &dev)
Definition: rs_device.hpp:104
Definition: rs_pipeline.hpp:18
bool operator==(const device_list_iterator &other) const
Definition: rs_device.hpp:258
rs2_sensor * rs2_create_sensor(const rs2_sensor_list *list, int index, rs2_error **error)
void rs2_delete_device(rs2_device *device)
void connect_controller(const std::array< uint8_t, 6 > &mac_addr)
Definition: rs_device.hpp:341
const unsigned char * rs2_get_raw_data(const rs2_raw_data_buffer *buffer, rs2_error **error)
void disconnect_controller(int id)
Definition: rs_device.hpp:352
rs2_device * rs2_create_device(const rs2_device_list *info_list, int index, rs2_error **error)
device_list & operator=(std::shared_ptr< rs2_device_list > list)
Definition: rs_device.hpp:208
Definition: rs_context.hpp:11
void rs2_delete_raw_data(const rs2_raw_data_buffer *buffer)
Definition: rs_context.hpp:78
int rs2_get_raw_data_size(const rs2_raw_data_buffer *buffer, rs2_error **error)
T as() const
Definition: rs_device.hpp:129
void rs2_connect_tm2_controller(const rs2_device *device, const unsigned char *mac_addr, rs2_error **error)
device_list_iterator begin() const
Definition: rs_device.hpp:273
void rs2_loopback_enable(const rs2_device *device, const char *from_file, rs2_error **error)
void rs2_disconnect_tm2_controller(const rs2_device *device, int id, rs2_error **error)
Definition: rs_device.hpp:149
bool is_loopback_enabled() const
Definition: rs_device.hpp:329
device operator[](uint32_t index) const
Definition: rs_device.hpp:214
int rs2_supports_device_info(const rs2_device *device, rs2_camera_info info, rs2_error **error)
void rs2_delete_sensor(rs2_sensor *sensor)
int rs2_is_device_extendable_to(const rs2_device *device, rs2_extension extension, rs2_error **error)
device front() const
Definition: rs_device.hpp:233
uint32_t size() const
Definition: rs_device.hpp:225
void hardware_reset()
Definition: rs_device.hpp:90
const std::shared_ptr< rs2_device > & get() const
Definition: rs_device.hpp:116
std::shared_ptr< rs2_device > _dev
Definition: rs_device.hpp:143
void rs2_hardware_reset(const rs2_device *device, rs2_error **error)
rs2_sensor_list * rs2_query_sensors(const rs2_device *device, rs2_error **error)
static void handle(rs2_error *e)
Definition: rs_types.hpp:121
Definition: rs_types.h:118
bool contains(const device &dev) const
Definition: rs_device.hpp:200
const rs2_raw_data_buffer * rs2_send_and_receive_raw_data(rs2_device *device, void *raw_data_to_send, unsigned size_of_raw_data_to_send, rs2_error **error)
Definition: rs_types.h:97
bool supports(rs2_camera_info info) const
Definition: rs_device.hpp:66
device & operator=(const std::shared_ptr< rs2_device > dev)
Definition: rs_device.hpp:98
device_list_iterator & operator++()
Definition: rs_device.hpp:262
device_list()
Definition: rs_device.hpp:190
Definition: rs_device.hpp:184
Definition: rs_context.hpp:182
bool operator!=(const device_list_iterator &other) const
Definition: rs_device.hpp:254
void rs2_delete_sensor_list(rs2_sensor_list *info_list)
void enable_loopback(const std::string &from_file)
Definition: rs_device.hpp:308
struct rs2_device_list rs2_device_list
Definition: rs_types.h:156
debug_protocol(device d)
Definition: rs_device.hpp:152
void disable_loopback()
Definition: rs_device.hpp:318
tm2(device d)
Definition: rs_device.hpp:293
device_list_iterator end() const
Definition: rs_device.hpp:277
Definition: rs_device.hpp:290
struct rs2_error rs2_error
Definition: rs_types.h:149
Definition: rs_device.hpp:239
void rs2_loopback_disable(const rs2_device *device, rs2_error **error)
Definition: rs_device.hpp:18
int rs2_get_device_count(const rs2_device_list *info_list, rs2_error **error)
const rs2_device_list * get_list() const
Definition: rs_device.hpp:281
T first() const
Definition: rs_device.hpp:52
virtual ~device()
Definition: rs_device.hpp:134
device(std::shared_ptr< rs2_device > dev)
Definition: rs_device.hpp:144
const char * rs2_get_device_info(const rs2_device *device, rs2_camera_info info, rs2_error **error)