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

Buffer size of 64 is too small for a complete response. #63

Open
peterj43 opened this issue May 7, 2020 · 3 comments
Open

Buffer size of 64 is too small for a complete response. #63

peterj43 opened this issue May 7, 2020 · 3 comments

Comments

@peterj43
Copy link
Contributor

peterj43 commented May 7, 2020

I have been using the example code (h_SDI-12_slave and f_basic-data request) and find if I issue a "aC!" command followed by a "aD0" I do not receive all the character in the response. As the maximum length of the values is 75 long

+ + + I would expect the max buffer size to be at least 79 chars long. I have tested increasing the buffer and I now receive the full response. I am performing e2e test on an Arduino MKRWifi1010 and ESP32.

@Kevin-M-Smith
Copy link
Collaborator

Kevin-M-Smith commented May 7, 2020

Good point, according to the latest specification, section 4.4, the response to a "Continuous Measurements and Request CRC" command is:

a<values><CRC><CR><LF>

where:

  • a is a single character
  • values has a maximum value of 75 characters.
  • CRC is 3 characters
  • CR is a single character
  • LF is a single character

suggesting the buffer should accommodate 81 characters.

@Kevin-M-Smith
Copy link
Collaborator

I believe the current value of 64 bytes for the buffer was merely for consistency with the hardware serial buffer limit on the Arduino Uno - I think it should just work to increase it.

Looking forward to the results of your end-to-end tests.

@SRGDamia1
Copy link
Contributor

PR merged. I'm leaving this open until I add the if's that I want around it.

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

No branches or pull requests

3 participants