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

Read with Length #74

Closed
tjstyle opened this issue Sep 9, 2016 · 3 comments
Closed

Read with Length #74

tjstyle opened this issue Sep 9, 2016 · 3 comments

Comments

@tjstyle
Copy link

tjstyle commented Sep 9, 2016

Hi..

are this library can read specific length like on C programming:
byte[] readBuffer = serial.read(5); //to read only 5 bytes in C

Regards,
TJ.

@felHR85
Copy link
Owner

felHR85 commented Sep 13, 2016

Hi @tjstyle
I would do it this way for reading 3 bytes for example:

byte[] buffer = new byte[3];
syncRead(buffer, 0);

@tjstyle
Copy link
Author

tjstyle commented Sep 14, 2016

Hi @felHR85
Thanks for your suggestion.
there are any example for using sync operation for read & write?

Regards,
TJ.

@felHR85
Copy link
Owner

felHR85 commented Sep 22, 2016

Hi @tjstyle
This weekend I've added a little example based on the previous one using the synchronous calls.
https://github.com/felHR85/UsbSerial/tree/master/examplesync

Hope it helps.

@felHR85 felHR85 closed this as completed Jan 7, 2019
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

2 participants