Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dds_stream now inherits from dds_stream_base #11036

Merged
merged 7 commits into from
Oct 27, 2022
Merged

Conversation

maloel
Copy link
Collaborator

@maloel maloel commented Oct 27, 2022

Plus:

  • fix throws; in locked_transfer::send_receive (found by cppcheck)
  • fix bug in dds_stream_uid initialization (found by the new tests)
  • replace pyrealdds.device.foreach_stream() with .stream()
  • add stream checking to test-device-init

Tracked on LRS-502 (I think?)

@maloel maloel requested a review from OhadMeir October 27, 2022 09:11
@@ -15,7 +15,7 @@ namespace realdds {

union dds_stream_uid
{
uint32_t whole;
uint32_t whole = 0;
Copy link
Contributor

@OhadMeir OhadMeir Oct 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant
If a non-static data member has a default member initializer and also appears in a member initializer list, then the member initializer is used and the default member initializer is ignored
cppreference

Copy link
Collaborator Author

@maloel maloel Oct 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hehe
And the default ctor?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. It was hidden in a collapsed part of the code.

But seeing the two added initializations made me wonder which initialization prevails :-)

@@ -184,32 +186,31 @@ bool dds_device::impl::init()
LOG_ERROR( "Got VIDEO_STREAM_PROFILES with no data" );
break;
}

for( size_t i = 0; i < video_stream_profiles->num_of_profiles; ++i )
if( _streams.size() >= _expected_num_of_streams )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to add video_stream_profiles->num_of_profiles.
And Error only if greater than, when equals need to advance state machine

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're about to add a stream.
If we already have what we expected (or greater) then we throw an error.
What do the number of profiles have to do with it?

, index( static_cast< int8_t >( index_ ))
{}
{
whole = 0; // it covers an extra byte, which needs to be 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to change in default constructor as well?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the default uses the = 0 from above.

@maloel maloel merged commit 43bebc7 into IntelRealSense:dds Oct 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants