Skip to content

Conversation

@AviaAv
Copy link
Contributor

@AviaAv AviaAv commented Nov 19, 2023

Tracked on [LRS-961]

@AviaAv AviaAv requested a review from Nir-Az November 19, 2023 09:41
@AviaAv AviaAv force-pushed the md_attribute_parser_with_crc-to-dev branch 2 times, most recently from 7111633 to fb6cf8b Compare December 13, 2023 08:37
@AviaAv AviaAv force-pushed the md_attribute_parser_with_crc-to-dev branch from fb6cf8b to 653da4b Compare December 17, 2023 10:02

if (!is_crc_valid(s))
{
LOG_DEBUG("Metadata CRC mismatch");
Copy link
Collaborator

Choose a reason for hiding this comment

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

'LOG_WARNING?'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the way it was originally, and it is also LOG_DEBUG in the parent class in is_attribute_valid function, when we find "metadata mismatch"

{
Attribute crc = *(Attribute*)(reinterpret_cast<const uint8_t*>(md_info) + _crc_offset); //Attribute = CRC's type (ex. uint32_t)
auto computed_crc32 = rsutils::number::calc_crc32(reinterpret_cast<const uint8_t*>(md_info),
sizeof(S) - sizeof(crc));
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is this for?
sizeof(S) - sizeof(crc));?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

S is the struct that have all of the attributes, including the crc.
So we pass the size of all other attributes as a buffer for calc_crc32

@Nir-Az Nir-Az merged commit 0470764 into IntelRealSense:development Dec 18, 2023
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