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

Change read to return up to available bytes #5

Merged
merged 4 commits into from
Nov 20, 2015

Conversation

sandeepmistry
Copy link
Contributor

Resolves #2.

Before read was only returning bytes that were buffered, instead of all the bytes in the parsed packet.

Also, changed available to return the bytes available in the current parsed packet, as per API spec. Previously, it was return bytes available in the buffer, if it was smaller than the packet size.

cc/ @cmaglie @facchinm

Also only call recvfrom if there is more data in the currently parsed
packet and make read() call read(unsigned char* buf, size_t size), to
remove duplication.
@cmaglie cmaglie added the type: imperfection Perceived defect in any part of project label Nov 6, 2015
@cmaglie cmaglie self-assigned this Nov 6, 2015
@sandeepmistry
Copy link
Contributor Author

I've updated the pull request based on @ThibaultRichard's comment sandeepmistry@06a6a7f#commitcomment-14252712

@facchinm
Copy link
Contributor

Works perfectly with both AVR and 101 boards 👍

@cmaglie cmaglie merged commit e352670 into arduino-libraries:master Nov 20, 2015
@sandeepmistry sandeepmistry deleted the limited-ram-udp-read branch January 4, 2016 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants