-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
[bytebuffer] Rework ByteBuffer using templates #7638
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #7638 +/- ##
==========================================
+ Coverage 53.70% 53.98% +0.27%
==========================================
Files 50 50
Lines 9408 9764 +356
Branches 1654 1344 -310
==========================================
+ Hits 5053 5271 +218
- Misses 4056 4167 +111
- Partials 299 326 +27 ☔ View full report in Codecov by Sentry. |
Hey there @clydebarrow, CODEOWNERS = ["@clydebarrow"] And run (message by NeedsCodeownersLabel) |
What does this implement/fix?
With requests for additional functionality in the ByteBuffer class I've reworked it using templates and all in-lineable functions. This will:
The additional functionality requested (see #7625) was to allow puts and gets into the buffer without changing the current position. This is achieved with functions as below. In addition templated functions are added for all data types.
Where T can be any of the supported types (8, 16, 32 bit integers, signed or unsigned, float or double.)
Now a component
The code has been moved from core into its own component. This will require any component using it to auto-load
bytebuffer
. The rationale for this change is to eliminate any possible code footprint whenByteBuffer
is not used, and to facilitate CI testing.Tests
Ideally this would be tested during CI with unit tests. This is currently not possible within the existing CI framework.
The test code only gets built during CI but it has been runtime tested on host and ESP32 platforms.
Types of changes
Related issue or feature (if applicable): fixes
Pull request in esphome-docs with documentation (if applicable): esphome/esphome-docs#
Test Environment
Example entry for
config.yaml
:# Example config.yaml
Checklist:
tests/
folder).If user exposed functionality or configuration variables are added/changed: