Skip to content

Commit 1dd69b7

Browse files
OhadMeirNir-Az
authored andcommitted
Rename uvc_device_info fields: mipi->is_mipi, conn_spec->usb_conn_spec
1 parent 95b17c1 commit 1dd69b7

5 files changed

Lines changed: 14 additions & 14 deletions

File tree

src/ds/d500/d500-device.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ namespace librealsense
410410

411411
auto raw_sensor = get_raw_depth_sensor();
412412
_pid = group.uvc_devices.front().pid;
413-
_is_mipi_device = group.uvc_devices.front().mipi;
413+
_is_mipi_device = group.uvc_devices.front().is_mipi;
414414

415415
_color_calib_table_raw = [this]()
416416
{

src/ds/d500/d500-factory.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ namespace librealsense
475475
auto dev_info = std::dynamic_pointer_cast< const d500_info >( shared_from_this() );
476476

477477
auto pid = _group.uvc_devices.front().pid;
478-
bool is_mipi = _group.uvc_devices.front().mipi;
478+
bool is_mipi = _group.uvc_devices.front().is_mipi;
479479

480480
try
481481
{

src/linux/backend-v4l2.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -937,7 +937,7 @@ namespace librealsense
937937
info.unique_id = busnum + "-" + devpath + "-" + devnum;
938938
// Find the USB specification (USB2/3) type from the underlying device, traversing from
939939
// /sys/devices/.../M-N/3-6:1.0/video4linux/video0 up to /sys/devices/.../M-N/version
940-
info.conn_spec = v4l_usb_logic::get_usb_connection_type(video_path + "/../../../");
940+
info.usb_conn_spec = v4l_usb_logic::get_usb_connection_type(video_path + "/../../../");
941941
info.uvc_capabilities = get_dev_capabilities(dev_name).device_caps;
942942

943943
return info;
@@ -992,8 +992,8 @@ namespace librealsense
992992
break;
993993
}
994994
}
995-
info.conn_spec = usb_undefined;
996-
info.mipi = true;
995+
info.usb_conn_spec = usb_undefined;
996+
info.is_mipi = true;
997997
info.uvc_capabilities = get_dev_capabilities(dev_name).device_caps;
998998

999999
return info;
@@ -1223,7 +1223,7 @@ namespace librealsense
12231223
v4l_uvc_device::v4l_uvc_device(const uvc_device_info& info, bool use_memory_map)
12241224
: _name(info.id),
12251225
_device_path(info.device_path),
1226-
_device_usb_spec(info.conn_spec),
1226+
_device_usb_spec(info.usb_conn_spec),
12271227
_info(info),
12281228
_is_capturing(false),
12291229
_is_alive(true),
@@ -2823,7 +2823,7 @@ namespace librealsense
28232823

28242824
std::shared_ptr<uvc_device> v4l_backend::create_uvc_device(uvc_device_info info) const
28252825
{
2826-
bool mipi_device = info.mipi;
2826+
bool mipi_device = info.is_mipi;
28272827

28282828
auto v4l_uvc_dev = mipi_device ? std::make_shared<v4l_mipi_device>(info) :
28292829
((!info.has_metadata_node) ? std::make_shared<v4l_uvc_device>(info) :

src/platform/uvc-device-info.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,19 @@ struct uvc_device_info
2222
std::string device_path;
2323
std::string dfu_device_path; // for mipi multiple cameras
2424
std::string serial;
25-
usb_spec conn_spec = usb_undefined;
25+
usb_spec usb_conn_spec = usb_undefined;
2626
uint32_t uvc_capabilities = 0;
2727
bool has_metadata_node = false;
2828
std::string metadata_node_id;
29-
bool mipi = false; // enumerated over a MIPI/GMSL V4L2 node rather than USB
29+
bool is_mipi = false; // enumerated over a MIPI/GMSL V4L2 node rather than USB
3030

3131
operator std::string() const
3232
{
3333
std::ostringstream s;
3434
s << "id- " << id << "\nvid- " << std::hex << vid << "\npid- " << std::hex << pid << "\nmi- " << std::dec << mi
3535
<< "\nunique_id- " << unique_id << "\npath- " << device_path << "\nUVC capabilities- " << std::hex
36-
<< uvc_capabilities << "\nUVC specification- " << std::hex << (uint16_t)conn_spec << std::dec
37-
<< ( has_metadata_node ? ( "\nmetadata node-" + metadata_node_id ) : "" ) << ( mipi ? "\nmipi" : "" ) << std::endl;
36+
<< uvc_capabilities << "\nUVC specification- " << std::hex << (uint16_t)usb_conn_spec << std::dec
37+
<< ( has_metadata_node ? ( "\nmetadata node-" + metadata_node_id ) : "" ) << ( is_mipi ? "\nmipi" : "" ) << std::endl;
3838

3939
return s.str();
4040
}
@@ -49,7 +49,7 @@ struct uvc_device_info
4949
inline bool operator==( const uvc_device_info & a, const uvc_device_info & b )
5050
{
5151
return ( a.vid == b.vid ) && ( a.pid == b.pid ) && ( a.mi == b.mi ) && ( a.unique_id == b.unique_id )
52-
&& ( a.id == b.id ) && ( a.device_path == b.device_path ) && ( a.conn_spec == b.conn_spec );
52+
&& ( a.id == b.id ) && ( a.device_path == b.device_path ) && ( a.usb_conn_spec == b.usb_conn_spec );
5353
}
5454

5555

src/uvc/uvc-device.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ namespace librealsense
5656
device_info.mi = info.mi;
5757
device_info.unique_id = info.unique_id;
5858
device_info.device_path = info.id;
59-
device_info.conn_spec = info.conn_spec;
59+
device_info.usb_conn_spec = info.conn_spec;
6060
//LOG_INFO("Found UVC device: " << std::string(device_info).c_str());
6161
rv.push_back(device_info);
6262
}
@@ -350,7 +350,7 @@ namespace librealsense
350350

351351
usb_spec rs_uvc_device::get_usb_specification() const
352352
{
353-
// On Win7, USB type is determined only when the USB device is created, _info.conn_spec holds wrong information
353+
// On Win7 the cached uvc_device_info.usb_conn_spec is wrong, so read it live from the USB device's own info
354354
return _usb_device->get_info().conn_spec;
355355
}
356356

0 commit comments

Comments
 (0)