forked from openthread/openthread
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…penthread#10719) This commit updates and clarifies the behavior of `Message::ReadByte()` and `Message::Read()` overloads regarding partial reads. - `ReadByte()` will read the available bytes and return the actual number of bytes read if fewer bytes are available in the message than the requested read length. This behavior remains unchanged. The documentation is updated to emphasize this behavior. - `Read()` methods return `kErrorParse` if the requested length cannot be read. This is the existing behavior which remains unchanged. Previously, `Read()` methods would still perform a partial read and populate the buffer/object with as many bytes that could be read, even in case of failure and returning `kErrorParse`. This behavior has been changed in this commit so the method will skip reading/copying bytes if the full length cannot be read. This aligns the documentation and behavior with how the `Read()` methods are used and intended to be used within the OT stack.
- Loading branch information
Showing
3 changed files
with
44 additions
and
16 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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