Skip to content

Conversation

@Leptopt1los
Copy link
Contributor

@Leptopt1los Leptopt1los commented Dec 12, 2023

What's new

  • nfc_util_bytes2num_little_endian function added

Problem:
When developing parsers, i often come across cards in which data is stored in little endian. in nfc_util.c there is a function uint64_t nfc_util_bytes2num(const uint8_t* src, uint8_t len), which reads len bytes at the src pointer and returns them as a number. The problem is that it reads them as big endian, and there is no alternative. Accordingly, for each such case I have to write an extra loop and read everything manually

This feature will solve the problem

Verification

  • test that the function does not go beyond boundaries
  • test the correctness of operation (the result is indeed a representation of the little endian number stored in the src)

Checklist (For Reviewer)

  • PR has description of feature/bug or link to Confluence/Jira task
  • Description contains actions to verify feature/bugfix
  • I've built this code, uploaded it to the device and verified feature/bugfix

hedger
hedger previously requested changes Dec 12, 2023
Copy link
Member

@hedger hedger left a comment

Choose a reason for hiding this comment

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

Please sync changes across all targets (./fbt TARGET_HW=18).

@Leptopt1los
Copy link
Contributor Author

Please sync changes across all targets (./fbt TARGET_HW=18).

done

@hedger hedger self-requested a review December 12, 2023 14:00
gornekich
gornekich previously approved these changes Dec 13, 2023
@skotopes skotopes merged commit 36aecfb into flipperdevices:dev Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

NFC NFC-related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants