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

Stream definition should be Arduino-compliant #2189

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

rgiese
Copy link

@rgiese rgiese commented Sep 5, 2020

Problem

The definition of Stream::readBytes is not fully Arduino-compliant: it should accept both a char* and uint8_t* for its buffer pointer. Particle's default compiler settings won't allow the cast to happen automagically, which means some dependent libraries don't compile. Sadness.

Solution

Create a function that accepts the missing type and forwards it with an appropriate cast.

Steps to Test

Build device-os/main with make PLATFORM=argon.

References

Thanks to @DavidEGrayson for recommending this fix on pololu/tic-arduino#1.


Completeness

  • User is totes amazing for contributing!
  • Contributor has signed CLA (Info here)
  • Problem and Solution clearly stated
  • Run unit/integration/application tests on device
  • Added documentation
  • Added to CHANGELOG.md after merging (add links to docs and issues)

@avtolstoy
Copy link
Member

Thanks for the PR. While this does address Stream::readBytes(), if we are making this change, other methods should also be considered e.g. Stream::readBytesUntil(), Stream::find() etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants