embedded-batteries: Implement TryFrom<u32> for ACPI types#39
Merged
kurtjd merged 1 commit intoOpenDevicePartnership:mainfrom Jan 20, 2026
Merged
embedded-batteries: Implement TryFrom<u32> for ACPI types#39kurtjd merged 1 commit intoOpenDevicePartnership:mainfrom
kurtjd merged 1 commit intoOpenDevicePartnership:mainfrom
Conversation
1fd752a to
0973952
Compare
RobertZ2011
approved these changes
Jan 20, 2026
kurtjd
added a commit
to OpenDevicePartnership/embedded-services
that referenced
this pull request
Jan 20, 2026
Some serialization/deserialization was omitted because it wouldn't be used by the EC, however the service-message crates can be used outside the EC, so add them in. I experimented with zerocopy for this in #678 but it's a bit clunky and getting it to work for Battery messages will be challenging, so just rolled it by hand for now since that's what we are already doing. Can revisit later once we've decided on a serialization strategy. Tested these by using the service message crates to serialize/deserialize messages over UART in the ratatui and works fine for the ones I could test (though many of the battery commands are not yet supported by the ratatui app). Was going to wait until OpenDevicePartnership/embedded-batteries#39 is merged, but it seems relying on an updated `embedded-batteries` causes a ton of breakage and headache, so just have functions for converting in here and can update a later time.
tullom
approved these changes
Jan 20, 2026
Contributor
tullom
left a comment
There was a problem hiding this comment.
Looks good, i have another change coming down the pipe so ill include this change as in one uprev
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A few of the ACPI types were missing a
TryFrom<u32>impl which is useful for de-serialization purposes. Didn't see a suitable existingErrortype to use so decided to just use unit type for errors since there isn't really any useful info to return for these.Resolves #38