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

Parse manufacturer data in AdStructure #138

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

iamtio
Copy link

@iamtio iamtio commented Oct 12, 2024

Implemented parsing of the manufacturer data for AdStructure

Comment on lines +488 to +489
0xff => Ok(AdStructure::ManufacturerSpecificData {
company_identifier: LittleEndian::read_u16(&data[..2]),

Choose a reason for hiding this comment

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

You can use u16::from_le_bytes() to avoid the byteorder dependency. Also, this clause should probably guarded to ensure the data is at least 2 bytes long (e.g. 0xff if data.len() >= 2 => Ok(...))

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