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

Extend the BufferReader and BufferWriter to handle signed integers #27629

Closed
hicklin opened this issue Jul 5, 2023 · 0 comments · Fixed by #27637
Closed

Extend the BufferReader and BufferWriter to handle signed integers #27629

hicklin opened this issue Jul 5, 2023 · 0 comments · Fixed by #27637

Comments

@hicklin
Copy link
Contributor

hicklin commented Jul 5, 2023

Feature description

The BufferReader and BufferWriter classes in /src/lib/support do not currently support the reading and writing of signed integers.

Add reading and writhing of in8_t, int16_t, intu32_t and int64_t.

Platform

all

Platform Version(s)

No response

Anything else?

No response

@tcarmelveilleux tcarmelveilleux changed the title Extende the BufferReader and BufferWriter to handle signed integers Extend the BufferReader and BufferWriter to handle signed integers Jul 5, 2023
@tcarmelveilleux tcarmelveilleux self-assigned this Jul 5, 2023
tcarmelveilleux pushed a commit to tcarmelveilleux/connectedhomeip that referenced this issue Jul 5, 2023
Problem:

- Safe buffer reader/writer doesn't support signed values
- Safe buffer reader/writer doesn't support bools
- Fixes project-chip#27629

This PR:

- Adds signed and bool support to BufferWriter and to Reader
- Adds missing unit tests
- Makes it clear that low-level reads are not to be used directly

Testing done:
- Integration tests pass
- New unit tests added and pass
- Existing unit tests all pass
@mergify mergify bot closed this as completed in #27637 Jul 6, 2023
mergify bot pushed a commit that referenced this issue Jul 6, 2023
* Add support for signed/bool to BufferReader/Writer

Problem:

- Safe buffer reader/writer doesn't support signed values
- Safe buffer reader/writer doesn't support bools
- Fixes #27629

This PR:

- Adds signed and bool support to BufferWriter and to Reader
- Adds missing unit tests
- Makes it clear that low-level reads are not to be used directly

Testing done:
- Integration tests pass
- New unit tests added and pass
- Existing unit tests all pass

* Restyled by clang-format

---------

Co-authored-by: [email protected] <[email protected]>
Co-authored-by: Restyled.io <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants